The following articles mainly describe how to solve the problem of MySQL Chinese display. The problem of MySQL Chinese display has always been a nightmare for colleagues in actual operations, the following article provides the actual cracking solutions for MySQL Chinese display problems.
I have been working on MySQL Chinese display problems for the last two days. It is quite depressing.
Test Platform: struts1.2 + myeclipse5.5 + hibernate + MySQL5.1
The test results today are:
When the default Character Set of MySQL is set as follows, show variables ;)
- character_set_client | utf8
- character_set_connection | utf8
- character_set_database | utf8
- character_set_filesystem | binary
- character_set_results | utf8
- character_set_server | utf8
- character_set_system | utf8
- character_sets_dir | C:\MySQL-5.1.6\share\charsets\
The content of the my. ini file is as follows:
- [MySQLd]
- basedir=C:/MySQL-5.1.6
- datadir=C:/MySQL-5.1.6/data
- default-character-set=utf8
- [client]
- port=3306
- [MySQL]
- default-character-set=utf8
- [WinMySQLadmin]
- Server=C:/MySQL-5.1.6/bin/MySQLd-nt.exe
Or in the MySQL Chinese display issue
Set the content of the my. ini file:
- [MySQLd]
- basedir=C:/MySQL-5.1.6
- datadir=C:/MySQL-5.1.6/data
- default-character-set=gbk
- [client]
- port=3306
- [MySQL]
- default-character-set=gbk
- [WinMySQLadmin]
- Server=C:/MySQL-5.1.6/bin/MySQLd-nt.exe
The url configuration of hibernate is as follows:
- <property name="connection.url">
- jdbc:MySQL://localhost:3306/test
- </property>
The above content is an introduction to the MySQL Chinese display problem. I hope you will get something better.