MySQL and navicat for MySQL Chinese garbled

Source: Internet
Author: User

Use UTF8 encoding all

MySQL Chinese garbled solution

    • To view the default encoding format:
Mysql> Show variables like "%char%";  
    • To set the encoding format:
SET character_set_client= ' UTF8 ';  SET character_set_connection= ' UTF8 ';  SET character_set_server= ' UTF8 ';  
    • To view the encoding format of the database test:
    • To set the encoding format for database test:
ALTER DATABASE ' test ' DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;  
    • To view the encoding format for the data table testtable:
Mysql> Show CREATE TABLE testtable;  
    • To set the encoding format for the data table testtable:
ALTER TABLE ' testtable ' DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;  
    • Specify UTF8 encoding when creating databases and data tables:
Create database ' Test '  CHARACTER SET ' UTF8 '  COLLATE ' utf8_general_ci ';  
Build data table CREATE TABLE ' Database_user ' (  ' ID ' varchar (+) NOT null default ' ',  ' UserID ' varchar (+) NOT null default ' ',  ) Engine=innodb DEFAULT Charset=utf8;  

After the setup is complete, the query Chinese display is normal

Navicat for MySQL Chinese garbled

    • modifying Navicat server connection properties and database properties

Reconnect still garbled

    • Modify the MySQL installation directory under the My.ini file

Reconnect still garbled

    • Navicat connection encoding format to "current Windows Codepage"

Reconnect, show normal

  

MySQL and navicat for MySQL Chinese garbled

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.