How to solve Chinese garbled characters when Navicat connects to the mysql database

Source: Internet
Author: User
Chinese characters are often garbled in php or mysql. Most of the reasons for this problem are the database encoding or client encoding problems. The following describes how to solve Chinese garbled characters.

Chinese characters are often garbled in php or mysql. Most of the reasons for this problem are the database encoding or client encoding problems. The following describes how to solve Chinese garbled characters.

Refer to the following solutions

Click a connection -- properties-switch to the Advanced tab-remove the use mysql character set Option checked-select 65001 (UTF-8) or 10008-GB2312 at encoding, then, the Chinese characters are displayed normally.

If the above method cannot be solved, refer

The default encoding in the my. ini file under the mysql installation directory is incorrect.

The Code is as follows:
========================================================== =
[Mysql]
Default-character-set = utf8 <------
========================================================== =
[Mysqld]
# The TCP/IP Port the MySQL Server will listen on
Port = 3306
# Path to installation directory. All paths are usually resolved relative to this.
Basedir = "C:/Program Files/MySQL Server 5.0 /"
# Path to the database root
Datadir = "C:/Program Files/MySQL Server 5.0/Data /"
# The default character set that will be used when a new schema or table is
# Created and no character set is defined
Default-character-set = utf8 <------

========================================================== ===
The arrow indicates utf8 (not UTF-8). The mysql character set is used in navicat (UTF-8 encoding is not required at this time ).

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.