This is an entry-level mysql tutorial. Here we will introduce the mysql database creation and deletion commands. If you have any questions, please refer to them.
This is an entry-level mysql tutorial. Here we will introduce the mysql database creation and deletion commands. If you have any questions, please refer to them.
Create a database
Command:
The Code is as follows: |
|
Create database <数据库名> |
Example 1:
Create a database named xhkdb
The Code is as follows: |
|
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 three commands in sequence to create a database. Note: You must set the Chinese "password" and "Database ".
Delete database commands
The Code is as follows: |
|
Drop database <数据库名> |
Example 1:
Delete A database named xhkdb
The Code is as follows: |
|
Mysql> drop database xhkdb; |
Example 2:
Delete an existing database
The Code is as follows: |
|
Mysql> drop database drop_database; Query OK, 0 rows affected (0.00 sec) |