The following operations are tested in MySQL 5 on Windows XP
Now I have changed the storage engine MyISAM to InnoDB and renamed the encoding utf8 as an example.
1. Open the MySQL configuration file named my. ini.
Add the following content under [mysqld:
Default-storage-engine = InnoDB
Character_set_server = utf8
Init_connect = 'set names utf8'
Add the following to [client:
Default-character-set = utf8
Restart MySQL Service
2. Use commands
(1) view the current encoding \ s;
The above four codes are both gb2312 and can be entered in Chinese.
(2) If not, modify the Encoding
Set names gb2312; -- change the next two
Set character_set_server = gb2312;
Set character_set_database = gb2312;
Then execute:
Set collation_server = gb2312_chinese_ci
Set collation_database = gb2312_chinese_ci
Set collation_connection = gb2312_chinese_ci
Go to the command line to start the MySQL tool and view the storage engine and encoding respectively.
Mysql> show variables like '% storage_engine % ';
Mysql> show variables like 'character _ SET _ % ';
Compare before and after the restart to see if it has taken effect