Installed is the decompression version of MySQL, specific configuration reference: Https://jingyan.baidu.com/article/9c69d48f85032f13c9024e15.html.
1: Unzip and then copy a My.ini file and add the byte encoding configuration:
[Client]default-character-set=gbk[mysqld]character-set-server=utf8
Specify the database configuration file bin\mysqld--defaults-file=my.ini--initialize-insecure Specify the configuration file My.ini (if this step is omitted, the configuration My.ini will not take effect, a little pit)
Installation database: Bin/mysqld--install
Start the database service: net start MySQL (in Windows environment)
2: Specify the database encoding when creating the database:
3 Specify UTF8 encoding when creating a table:
CREATE TABLE ' demo_table ' ( ' name ' varchar (255) NOT NULL, ' created_at ' timestamp not null DEFAULT Current_timesta MP, ' modified_at ' timestamp not NULL DEFAULT ' 0000-00-00 00:00:00 ' on UPDATE current_timestamp, ' Size ' bigint (20 Default NULL, ' type ' varchar (255) default NULL, ' label ' varchar (255) default NULL, PRIMARY KEY ( ' Name ', ' created_by ') Engine=innodb DEFAULT Charset=utf8;
Decompression version of Chinese garbled problem MySQL Chinese garbled