navicat for MySQL display Chinese garbled solution
Recently encountered a problem, using Navicat for MySQL to open the database is all displayed garbled (in the program code before inserting data to ensure that characters are not garbled), encountered problems in the search for a solution, Baidu has not solved for a long time, the online solutions are not suitable for my problem, Most of the solution on the Internet is to right-click a connection in the Navicat, select the connection properties, switch to the Advanced tab, remove the "use MySQL character set" before the tick, in the code to select Utf-8, this method for some problems may be appropriate, but my garbled problem still exists, So I changed the Utf-8 to gbk,gb2312, all the questions still remain the same.
Later, with a programmer of the old programmer consulted, he said there may be a problem with the configuration file MySQL, is in the MySQL installation directory in the My.ini file in the default encoding problem, will be My.ini file the default code in both places
==========================================
[MySQL]
Default-character-set=utf8 <------
==========================================
[Mysqld]
# The TCP/IP Port the MySQL Server would listen on
port=3306
#Path to installation directory. All paths is usually resolved relative to this.
Basedir= "C:/Program files/mysql/mysql Server 5.0/"
#Path to the database root
Datadir= "C:/Program files/mysql/mysql Server 5.0/data/"
# The default character set that would be used if a new schema or table is
# created and no character set is defined
Default-character-set=utf8 <------
===========================================
The arrow refers to the place to ensure that the UTF8 (note is not utf-8), navicat in the use of the MySQL character set (at this time no longer select Utf-8 encoding), the problem is resolved! My familiar Chinese characters are back! Any friend who wants to meet the same problem, hope to help.
Navicat for MySQL display Chinese garbled solution