All of my friends who want to learn MySQL will encounter Chinese Garbled text, which is very annoying. Next I will talk about the solution to the MySQL Garbled text problem and share it with you, I hope to provide you with some reference.
Method 1,
Open the MySQL command line client and set the following three items:
Set character_set_client = GBK;
Set character_set_results = GBK;
Set character_set_connection = GBK;
Then, set the value of default-character-set in the my. ini file under the MySQL installation directory to GBK (note that there are two changes to be made ).
Note: This method has a defect: After modification, garbled characters in the new table disappear, but garbled characters appear in the original table. The solution is, first, export and modify the data in the original table, then recreate the table, and then import the data.
Note: For character_set_client and so on,
See Chinese manual: http://dev.mysql.com/doc/refman/5.1/zh/charset.html
Method 2,
When installing MySQL, pay attention to the encoding settings and set it to GBK. This saves the trouble in the future.