Use the following command to view the MySQL character set
Connect to the MySQL service and enter the following command
Mysql>show variables like ' character_set% ';
Shown below:
In order for MySQL to support Chinese, you need to change the character set to UTF8,
Here's how:
1. Open VI/ETC/MY.CNF
2. Change to the following content, save
[client]port =3306 socket =/var/lib/mysql/mysql.sockdefault - Character-set=utf8[mysqld]datadir =/var/lib/ Mysqlsocket =/var/lib/mysql/mysql.sockdefault -character-set=utf8user =mysql# disabling symbolic -links is recommended to prevent assorted security riskssymbolic< /span>-links=0 [mysql]no -auto-rehashdefault -character-set=utf8[mysqld_safe]log -error=/var/log/mysqld.logpid -file=/var/run/mysqld/mysqld.pid
3. Restart MySQL Services: Service mysqld restart
Review the MySQL code again, updated to the following information
This will be OK, and then import the database will not appear in Chinese garbled
Mysql> Source/var/www/html/charge.sql
Completed
CentOS View and modify MySQL character set