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;