Inserting data in MySQL always shows yes??? Garbled. Online very many people said that the test is not correct, later after a large number of inquiries, the solution is written in the following. Different version numbers have different ways of solving it. My database version number (5.5.40)
[Client]
Default-character-set=utf8
[MySQL]
Default-character-set=utf8
[Mysqld]
Collation-server = Utf8_unicode_ci
init-connect= ' SET NAMES utf8′
Character-set-server = UTF8
Updated: 2014-12-27
Later when inserting data with hibernate found that inserted into the MySQL database is garbled, so changed the database configuration, with the framework of spring MVC, in Web. Xml added filter, changed the code of the JSP page. It is good to find the display and insert the Chinese in the database directly with insert. Only when using Hibernate save to insert the database is garbled, and finally found that hibernate save operation is not practical UTF8 encoding.
I changed it in hibernate configuration file, such as the following
Jdbc.url=jdbc:mysql://58.210.161.122/fpp_alarm_client?Createdatabaseifnotexist=true&useunicode=true&characterencoding=utf8&autoreconnect=true
About MySQL character encoding settings