MySql Chinese recognition problems

Source: Internet
Author: User

MySql Chinese recognition problems

I have always wanted to avoid the problem of MySql Chinese recognition, but I did use it when I was working on the project today, which made me very angry, after trying every means, I finally found a solution that is accurate to me for one night.

Because I directly installed wampserver, I don't know the version or why. I couldn't find the corresponding character encoding configuration in my. ini file.

Ah, think about it. Forget it. If this doesn't work, run the command directly. So I entered the following [1] [2] command. After I restarted MySql, it was found that there was no change at all, and it was still not recognized to add data after the command was entered. This is a problem, so I thought about it and looked for it .....

Finally, I found a relatively general method, that is, when I create a database, I should specify the character encoding, so I had to run the [4] command.

After testing, the database is perfectly compatible with Chinese characters. It means that Mysql does not recognize UTF-8 at the client end. This is what I want to do. Isn't one encoding complete?

So, we should continue to use our big country code...

SET character_set_server = gbk; // SET the server's character encoding [1]

SET character_set_database = gbk; // SET the character encoding of the database. [2]

Show variables like 'character % '; // query all character codes. [3]

Create database name character set gbk; [4]

SET character_set_server = gbk; // SET the character encoding of the server.

SET character_set_database = gbk; // sets the character encoding of the database.

Show variables like 'character % '; // query all character encodings

Create database name character set gbk;

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.