windows environment Mysql Chinese garble code problem solution
- 2020-05-19 06:03:37
- OfStack
Recently, in the development project, Mysql was picked up again. When building the environment, I encountered the problem of Chinese garbled codes. Let me share my solution with you
1. show VARIABLES like 'character_%'; Displays all the Settings. Set all the non-UTF8 encodings to utf8
Setting mode: set character_set_server=utf8;
2. Go to the mysql installation directory and find the my.ini file. Set latin1 inside to utf8
3. In addition, if there is a garbled code in the communication data of Java terminal, response.setCharacterEncoding (" utf-8 ") will be used;
1. show VARIABLES like 'character_%'; Displays all the Settings. Set all the non-UTF8 encodings to utf8
Setting mode: set character_set_server=utf8;
2. Go to the mysql installation directory and find the my.ini file. Set latin1 inside to utf8
3. In addition, if there is a garbled code in the communication data of Java terminal, response.setCharacterEncoding (" utf-8 ") will be used;