Creating a Database
Command:
The code is as follows |
Copy Code |
Create DATABASE < database name > |
Example 1:
Create a database named XHKDB
The code is as follows |
Copy Code |
1. CREATE database name; 2. GRANT select,insert,update,delete,create,drop,alter on database name. * To database name @localhost identified by ' password '; 3, SET PASSWORD for ' database name ' @ ' localhost ' = old_password (' password '); |
Execute 3 commands sequentially to complete the database creation. Note: Chinese "password" and "database" is the user needs to set the
Delete Database command
The code is as follows |
Copy Code |
Drop Database < database name > |
Example 1:
To delete a database named Xhkdb
The code is as follows |
Copy Code |
mysql> drop Database xhkdb; |
Example 2:
Delete a database that has been determined to exist
The code is as follows |
Copy Code |
mysql> drop Database drop_database; Query OK, 0 rows Affected (0.00 sec) |