Changes

Jump to navigation Jump to search

Coral: mysql create delete database

5,878 bytes added, 13:39, 12 November 2011
Created page with "<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font..."
<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font-size:12px">'''''Coral'' :'''&nbsp; [[Coral: mysql intro|MySQL]] | [[Coral: mysql change password|Change password]] | [[Coral: mysql restore password|Restore password]] | [[Coral: mysql console|MySQL Console]] | [[Coral: mysql create delete database|Create delete Database]] | [[Coral: mysql create restricted user|Create Restricted User]] | [[Coral: mysql edit restricted user|Edit Restricted User]]</span></div>

{|style="margin-top:5px;"
|-valign="top"
|
<span style="margin-bottom:5px;font-size:25px;color: #31799F;">MySQL Create delete Database</span>

There are three methods for creating or deleting a database; you can use a command window, phpMyAdmin or UniController. UniController provides a convenient menu option described bellow. To use this option ensure the MySQL server is running otherwise a warning message is produced.


__TOC__

|
{| cellpadding="0" cellspacing="0" style="margin-left:6px;margin-bottom:5px;padding-left:6px;padding-right:6px;font-size:11px;background-color: #FFFFEB;border: 1px solid darkslateblue;"
|-
|colspan="2" style="font-weight:bold;"| UniServer&nbsp;8-Coral
|-
|&nbsp;||[[Coral: Introduction|Home]]
|-
|&nbsp;||[[Coral: start quick start|Quick Start]]
|-
|&nbsp;||[[Coral: general intro|General]]
|-
|&nbsp;||[[Coral: apache intro|Apache]]
|-
|<span style="font-size: 14px;">ยป</span>||[[Coral: mysql intro|MySQL]]
|-
|&nbsp;||[[Coral: php intro|PHP]]
|-
|&nbsp;||[[Coral: msmtp intro|MSMTP]]
|-
|&nbsp;||[[Coral: cron intro|CRON]]
|-
|&nbsp;||[[Coral: dtdns intro|DtDNS]]
|-
|&nbsp;||[[Coral: dbbackup intro|Db Backup]]
|-
|&nbsp;||[[Coral: perl intro|Perl]]
|-
|&nbsp;||[[Coral: index main|Main Index]]
|}
|}

==Create Delete Database using UniController==
<span style="padding:6px;background-color:#99FFFF"> Server Configuration > MySQL > Create delete Database</span>

{|
|-
|
'''''Create Database'''''

* 1) Enter a databse name e.g mydb
* 2 Click "Create Database" button

'''''Delete Database'''''

* 3) Select a database to delete
* 5) Click "Delete Database" button

Note 1: Clear both (4) deletes entered name and database selected.
|
[[Image:Coral_mysql_create_delete_db.gif]]
|}

'''''[[#top | Top]]'''''
==Create Delete Database using phpMyAdmin==
Start UniController and click phpMyAmin button. To create or delete a database proceed as follows:

'''''Create Database'''''
{|
|-valign="top"
|
When first started, the phpMyAdmin home page is displayed. You can always return to this page by clicking the home icon (1)

* 1) If not at the home page, click '''home icon'''
* 2) From the top menu bar select '''Databases'''
* 3) Enter name of database to create; for example, "wordpress"
* 4) Optionally select a collation from the dropdown. No selection default is used (see note).
* 5) Click '''Create''' button, a created confirmation is displayed.

Note: On the home page the default collection is set to '''utf8_general_ci'''
|
[[Image:Coral_mysql_cdb_phpmyadmin3.gif]]
|}

'''''Delete Database'''''
{|
|-valign="top"
|
When first started, the phpMyAdmin home page is displayed. You can always return to this page by clicking the home icon (1)

* 1) If not at the home page, click '''home icon'''
* 2) From top menu bar select '''Databases'''
* 3) Select database to delete (drop); for example, "wordpress"
* 4) Click '''Drop''' button; an alert box is displayed.
* 5) Click '''Yes''' on alert box "You are about to DESTROY a complete database!"
* 6) A confirmation is displayed "1 databases have been dropped successfully."

|
[[Image:Coral_mysql_cdb_phpmyadmin4.gif]]
|}

'''''[[#top | Top]]'''''
==Create Delete Database using command window==
Click MySQL console, which opens a command window. You can use either of the MySQL utilities, Client or Admin, to create and delete a database as follows:

===Command window - mysqladmin===

'''''Create a database'''''

To create a database named '''joomla''', enter the following command into the window:

* mysqladmin.exe --user=root --password=root create joomla

'''''Delete a database'''''

To delete a database named '''joomla''', enter the following command into the window:

* mysqladmin.exe --user=root --password=root --force drop joomla

Note: You can specify the MySQL port to use:

* mysqladmin.exe --port=3306 --user=root --password=root create joomla
* mysqladmin.exe --port=3306 --user=root --password=root --force drop joomla

===Command window - mysql Client===
{|
|-valign="top"
|
'''''Create a database'''''

To create a database named '''wordpress''', enter the following commands into the window:

* mysql -uroot -proot
* At the mysql prompt type: CREATE DATABASE wordpress;
* At the mysql prompt type: exit
|
<pre>
C:\UniServer\usr\local\mysql\bin>mysql -uroot -proot

mysql> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.03 sec)

mysql> exit
Bye

</pre>
|-valign="top"
|
'''''Delete a database'''''

To delete a database named '''wordpress''', enter the following commands into the window:

* mysql -uroot -proot
* At the mysql prompt type: DROP DATABASE wordpress;
* At the mysql prompt type: exit
|
<pre>
C:\UniServer\usr\local\mysql\bin>mysql -uroot -proot

mysql> DROP DATABASE wordpress;
Query OK, 0 rows affected (0.17 sec)

mysql> exit
Bye

</pre>
|}
Note: If you have changed the MySQL root password, remember to substitute (-p'''root''') '''root''' with your password in the above.

'''''[[#top | Top]]'''''
==Related topics==

[[Coral: mysql console|MySQL Console]] <br>
[[Coral: mysql console#How to run a standard command window|How to run a standard command window]] <br>
[[Coral: mysql console#MySQL console command window short cut|MySQL console command window short cut]]


'''''[[#top | Top]]'''''

----

[[Category: Uniform Server 8-Coral]]

Navigation menu