Solution to MySQL garbled characters under Fedora15

Source: Internet
Author: User
Finally solved the Mysql garbled problem! The system is Fedora15. After using sudoyuminstallmysql-servermysql-client, modify/etc/my. cnf adds default-character-set = utf8 under [mysqld], restarts mysql, reports an error, views the log, and learns that the default-character-set configuration item is not recognized, this method is used for online query !!

Finally solved the Mysql garbled problem! The system is Fedora 15. After using sudo yum install mysql-server mysql-client, modify/etc/my. cnf

Add default-character-set = utf8 under [mysqld], restart mysql, and report an error. view the log,

I learned that the default-character-set configuration item is not recognized, and the cup is used for online query !!

Because I learned from mysql> show variables like 'character % '; only character_set_server is not utf8,

So I found this on the internet and finally accidentally found a netizen adding character_set_server = utf8 under [mysqld] in an article,

This is just a wake-up !!!

In addition, the modification of other character sets is similar to the above.

The following commands modify the encoding of databases, tables, and fields:

Alter database databasename character set utf8;

Alter table tablename convert to character set utf8;


Alter table 'tablename' change 'colname' varchar (200) character set utf8 not null;

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.