Garbled characters occur in Chinese when MySQL databases are used in the project (are all Chinese characters changed ?) Solution:
1. unified project and database coding, the project uses UTF-8, So I unified the database coding into UTF-8
Modification Method: Modify the my. ini file in the MySQL root directory to replace default-character-set = latin with default-character-set = utf8 (note that there are two parts to replace)
2. After the modification is completed, save and exit, and restart the MySQL service (the purpose of the restart is to re-load the configuration file), and re-create the database. <Strong? Http: www.bkjia.com kf ware vc "target =" _ blank "class =" keylink "> California + 0tb21xL3hufvI58/Co7o8L3A + CjxwPjxpbWcgc3JjPQ = "http://www.2cto.com/uploadfile/Collfiles/20140419/2014041909003725.jpg" alt = "">
At this moment, the problem of Chinese garbled characters in the project has been solved!
If you query data in the background at the moment, you will find that the background (DOS) database displays garbled characters. It is strange that all codes are unified, the reason is very simple because the default encoding of the DOS window is GBK and the database is configured with UTF-8 encoding, so the solution is to tell the database that my client encoding is not UTF-8 but GBK.
Modify the database client encoding: set nemas gbk;