These days in learning Hibernate, in the program will use hibernate to insert data into the MySQL database, found that there is a chinese garbled, searched the internet for a long time, The approximate solution is to modify the My.ini configuration file, modified to GBK, but the insertion of data is garbled. But in the end it was settled. Let's talk about the solution.
1. Locate the MySQL Server Instance onfiguration Wizard manager and reconfigure MySQL. The previous configuration can go all the way to the next step, in order to change the language to GBK.
2. To delete the previously established database, re-use the object to establish the database. Then reinsert the Chinese data. You can do it. There will be no garbled characters in Chinese.
In short, after the garbled is to reconfigure MySQL, rebuild the database.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
About hibernate inserting MySQL database Chinese data garbled processing