Mysql database garbled, mysql garbled
In the past, when mysql was used for installation, the character set was set to UTF-8, so there were very few garbled characters. When mysql in wampserver was used today, Chinese garbled characters were found to be submitted to the database, it is clear that the table creation uses UTF-8 and the server uses UTF-8, because garbled characters occur after the database server is changed. It seems that the problem must be on the database server, check the mysql configuration file and find that "default_character_set = utf8" is not configured. Add it after [client]. Restart the server and try again. the problem persists, move "default_character_set = utf8" to [mysqld] and try again. Restart the mysql service and you will find that mysql cannot be started. The configuration file has a problem, that is to say, you cannot put "default_character_set = utf8" after [mysqld], so the deletion and restart are started again. But the garbled code problem is not solved.
Check the status in mysql and find that the Server characterset and Db characterset are still not modified:
I had to continue to check the information. It seems that there are just a few versions. The methods I tried are still unsolvable. Finally, with my unremitting efforts, I found a solution and shared it with me. I believe some friends will encounter this problem.
My. ini
...
[Client]
...
Default_character_set = utf8
...
[Mysqld]
...
Character_set_server = utf8
...
After the configuration is complete, immediately restart the mysql service. The mysql service can be started normally. Try again to solve the garbled problem.
View the status in mysql as follows: