Mysql Chinese garbled solution, mysql garbled Solution

Source: Internet
Author: User

Mysql Chinese garbled solution, mysql garbled Solution

Problem description:Mysql displays garbled characters when inserting Chinese characters "? "No.

Solution:

Modify the my. ini configuration of mysql

[mysql]default_character_set=utf8[mysqld]character_set_server=utf8

 

 

 

 

// The following content is the test record content, which can be ignored and not read at all. However, to increase the credibility, we have attached the following content :)

Show variables like "% char % ";

Default Value:

+ -------------------------- + --------------------------------------------------- +

| Character_set_client | gbk |

| Character_set_connection | gbk |

| Character_set_database | latin1 |

| Character_set_filesystem | binary |

| Character_set_results | gbk |

| Character_set_server | latin1 |

| Character_set_system | utf8 |

| Character_sets_dir | c: \ wamp \ bin \ mysql \ mysql5.6.17 \ share \ charsets \ |

+ -------------------------- + --------------------------------------------------- +

(This launch is effective, and the cure is permanent)

Set names utf8:

+ -------------------------- + --------------------------------------------------- +

| Character_set_client | utf8 |

| Character_set_connection | utf8 |

| Character_set_database | latin1 |

| Character_set_filesystem | binary |

| Character_set_results | utf8 |

| Character_set_server | latin1 |

| Character_set_system | utf8 |

| Character_sets_dir | c: \ wamp \ bin \ mysql \ mysql5.6.17 \ share \ charsets \ |

+ -------------------------- + --------------------------------------------------- +

(Valid permanently)

My. ini

[Client]

Default_character_set = utf8

+ -------------------------- + --------------------------------------------------- +

| Character_set_client | utf8 |

| Character_set_connection | utf8 |

| Character_set_database | latin1 |

| Character_set_filesystem | binary |

| Character_set_results | utf8 |

| Character_set_server | latin1 |

| Character_set_system | utf8 |

| Character_sets_dir | c: \ wamp \ bin \ mysql \ mysql5.6.17 \ share \ charsets \ |

+ -------------------------- + --------------------------------------------------- +

(Permanently valid, with the same effect as [client] modification)

My. ini

[Mysql]

Default_character_set = utf8

+ -------------------------- + --------------------------------------------------- +

| Character_set_client | utf8 |

| Character_set_connection | utf8 |

| Character_set_database | latin1 |

| Character_set_filesystem | binary |

| Character_set_results | utf8 |

| Character_set_server | latin1 |

| Character_set_system | utf8 |

| Character_sets_dir | c: \ wamp \ bin \ mysql \ mysql5.6.17 \ share \ charsets \ |

+ -------------------------- + --------------------------------------------------- +

(Valid permanently and perfectly displayed in Chinese, avoiding the need to set names utf8 before each data Insert operation)

My. ini

[Mysql]

Default_character_set = utf8

[Mysqld]

Character_set_server = utf8

+ -------------------------- + --------------------------------------------------- +

| Character_set_client | utf8 |

| Character_set_connection | utf8 |

| Character_set_database | utf8 |

| Character_set_filesystem | binary |

| Character_set_results | utf8 |

| Character_set_server | utf8 |

| Character_set_system | utf8 |

| Character_sets_dir | c: \ wamp \ bin \ mysql \ mysql5.6.17 \ share \ charsets \ |

+ -------------------------- + --------------------------------------------------- +

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.