MySQL Character Set
1. display character sets
Mysqladmin-uroot-proot variables | grep character
| Character_set_client | Latin1 |
| Character_set_connection | Latin1 |
| Character_set_database | Latin1 |
| Character_set_results | Latin1 |
| Character_set_server | Latin1 |
| Character_set_system | utf8 |
| Character_sets_dir |/usr/local/share/MySQL/charsets/|
Database uses Latin1 (ISO-8859) by default)
Ii. configuring character sets
1. Configure character sets when creating a database
Create Database testxxx default charset = utf8
3. Configure character set during table Creation
Create Table 't_ agent '(
'Id' smallint (5) not null
) Default charset = utf8;
4. Modify Character Set
Windows Platform
The MySQL configuration file in Windows is my. ini, which is usually in C:/Windows/My. ini or C:/winnt/My. ini.
Default-character-set = GBK # Or gb2312, big5, utf8
Then restart MySQL
Service MySQL restart
Or
/Etc/init. d/MySQL restart
Or use another method to restart the instance.
[Edit] UNIX platform
The MySQL configuration file in Linux is my. CNF, which is usually/etc/My. CNF. If you cannot find it, run the find command to find it:
Find/-INAME my. CNF
Add
Default-character-set = GBK # Or gb2312, big5, utf8
Then restart MySQL
3. Configure the sorting Character Set
Myisamchk-r-Q -- Set-character-set = charset