CREATE DATABASE [IF not EXISTS] CHARACTER SET [=] UTF8;
The code in brackets is optional; Charater is created as the default character if you do not write.
After you have created the database, you can:
SHOW DATABASES;
See how many databases are currently available;
When using [IF not EXISTS] to create an existing database, there is no error, but a warning. Can be used:
SHOW WARNINGS;
To view the contents of the warning, although there is a bit of dog blood here, there may be other warnings later.
When modifying a keyword, alter, if you want to modify the T1 character set, use:
ALTER DATABASE CHARACTER SET = GBK;
After you have modified it, you can use:
CREATE DATABASE t1;
To display the instructions at the time of creation to see if the character set has been modified.
DROP DATABASE t1;
This removes the previously created T1 database.
MySQL Create, modify, and delete databases