1. Create a simple database
1 CREATE DATABASE t1;
If the image is not hit, the system waits until the user enters the Terminator before the line statement.
2. View the list of databases under the current server
1 DATABASES;
Must be databases, the last s cannot be omitted.
The 3.IF NOT EXISTS statement checks for the existence of the current database and, if present, generates a warning message without generating an error message.
1 CREATE DATABASE IF not EXISTS t1;
4. View the above warning message
1 SHOW WARNINGS;
s must not be omitted.
5. View instructions when creating a database
1 CREATE DATABASE t1;
6. Create a complete statement of the database
1 CREATE {DATABASE| SCHEMA [IF not EXISTS] db_name [DEFAULT] SET [=] charset_name;
7. Create a database example with GBK encoding format
CREATE DATABASE IF not EXISTS character Set GBK
Both default and = can be ignored.
MySQL Learning Note (4)-Creating a database