CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name [create_specification ...]create_specification: [DEFAULT] CHARACTER SET charset_name | [DEFAULT] COLLATE collation_name基本类似
CREATE DATABASE statement creates only a directory under the MySQL data directory and the db.opt file.
[code=BatchFile]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 3.23.58Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> CREATE DATABASE animals; Query OK, 1 row affected (0.00 sec) mysql>[/code]
[create_specification ...]create_specification:
[DEFAULT] CHARACTER SET charset_name
| [DEFAULT] COLLATE collation_name基本类似
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 3.23.58Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> CREATE DATABASE animals;
Query OK, 1 row affected (0.00 sec)
mysql>[/code]