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