1) when compiling MySQL, a default character set is specified, which is Latin1;
(2)
When installing MySQL, you can specify a default character set in the configuration file (My. INI). If it is not specified, this value is inherited from the value specified during compilation;
(3)
When starting mysqld, you can specify a default character set in the command line parameters. If this parameter is not specified, the value inherits from the configuration in the configuration file. In this case, character_set_server is set to the default character set;
(4) When creating a new database, unless explicitly specified, the character set of this database is set to character_set_server by default;
(5) When a database is selected, character_set_database is set to the default Character Set of the database. (The database must be set correctly ---)
(6) When creating a table in the database, the default Character Set of the table is set to character_set_database, which is the default Character Set of the database;
(7) When setting a column in a table, unless explicitly specified, the default character set in this column is the default Character Set of the table.
Enter show variables like '% chara %' to view the character set
Check whether the preceding parameter (character_set_server, character_set_database) is GBK.
Create a database !! The default character is gbk !!
In addition
(2) modify the character set of the database
Mysql> alter database mydb character set UTF-8;
(3) create a database and specify the character set of the database
Mysql> create database mydb character set UTF-8
You can modify .,..............