Mysql database garbled, mysql garbled

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.