[Problem] Database MySQL and navicat garbled problem

Source: Internet
Author: User

The characters stored in the computer need to use the encoding set, early ASCII set, but with the development of technology, the ASCII set can not meet the requirements, there are more and more characters, such as Chinese character. Later developed the Unicode, GB2312, UTF8 and other character sets. After the character set, the problem arises, if the runtime environment and the corresponding use of the character set is not the same as garbled or "? "As shown in.

In order for the characters to display correctly, first we need to adjust the MySQL file, locate the "My.ini" file under the MySQL installation folder, and set the character set to GB2312 as shown in.

Then set the data and the corresponding table's character set to UTF8. You can use the show create statement to view the database and the character set of the table, as shown in.

If the character set is not required, the character set can be modified using the ALTER statement, such as changing the character set to gb2312:

Note 1: You need to restart MySQL after you have modified the contents of "My.ini"

Note 2; When a character set is modified, it only works on the characters that are entered later, and has no effect on the characters entered earlier. Therefore, after modifying the character set, it is better to re-establish a database and then input data, so that all the input data format is uniform, there will be no part of the content is garbled part of the content and can display normally.

Sometimes there will be cmd input characters in the cmd can be normal display, and in the Navicat display garbled, and in the navicat inside the characters entered inside the Navicat can be normal display, in the cmd display garbled. The question I am talking about "My.ini" in the character set changed to gb2312 after the resolution, but the reason is not clear.

[Problem] Database MySQL and navicat garbled problem

Related Article

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.