1. List all character sets supported by MYSQL:
Show character set;
2. Current MYSQL Server Character Set
Show variables like 'character _ set _ % ';
3. Current MYSQL Server character set verification settings
Show variables like 'collation _ % ';
4. display character set settings of a Database
Name of the show create database;
5. display character set settings of a data table
Show create table name;
6. Modify the database Character Set
Alter database name default character set 'utf8 ';
7. Modify the character set of a data table
Alter table name default character set 'utf8 ';
8. Specify the character set during database creation
Create database name character set gbk collate gbk_chinese_ci;
9. Specify the character set during table Creation
Create table 'mysqlcode '(
'Id' TINYINT (255) unsigned not null AUTO_INCREMENT primary key,
'Content' VARCHAR (255) NOT NULL
) TYPE = myisam character set gbk COLLATE gbk_chinese_ci;
Library character set, the following code is missing in my. cnf:
[Client]
Default-character-set = utf8
[Mysqld]
Default-character-set = utf8
If the above Code is not added, even if the encoding specified during MYSQL compilation and installation is UTF8, the default encoding is LATIN1 during database creation. Due to the inheritance of the character set, the tables in the database are also latin1.
Program Access Data url parameters:
Jdbc: mysql: // localhost: 3306/testCharacter? AutoReconnect = true & useUnicode = yes & amp; characterEncoding = UTF8