Solve the problem of garbled Wamp MySQL database.

Source: Internet
Author: User

The general garbled situation:

If this kind of garbled on the console, generally on the phpmysqladmin will also appear garbled, because they are the same

One appears on the console and one appears on the page.

First output on the Mysql.exe

Mysql>show VARIABLES like ' character% ';

is right.

If not all of them set a utf8;

If the data is read in a PHP page,

Mysql_set_charset ("UTF8");//Do not use GBK  I tried, GBK will appear garbled mysql_query ("Set names ' UTF8 '")  //Two statements Select one can, generally choose the second one, The first one seems to be new, in order to be compatible with all, choose the second one

Garbled one basically solved.

Online a lot to add on the My.ini file

[MySQL] Plus
Default-character-set=utf8

[Mysqld] Plus
Character_set_server=utf8

Add the [client]
Default-character-set=utf8

Generally, I follow the above method to solve, preferably in wamp official download software, win7 above console command characters are supported in Chinese, XP seems to be modified, and good trouble.

Solve the problem of garbled Wamp MySQL database.

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.