1. 找文件
# find / -name *.cnf
/usr/share/mysql-test/include/default_mysqld.cnf
/usr/share/mysql-test/include/default_my.cnf
/usr/share/mysql-test/include/default_ndbd.cnf
/usr/share/mysql-test/std_data/ndb_config_mycnf1.cnf
/usr/share/mysql-test/std_data/bug15328.cnf
/usr/share/mysql-test/std_data/ndb_config_mycnf2.cnf
/usr/share/mysql-test/suite/ndb/my.cnf
/usr/share/mysql-test/suite/federated/my.cnf
/usr/share/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf
/usr/share/mysql-test/suite/rpl_ndb/my.cnf
/usr/share/mysql-test/suite/rpl/rpl_1slave_base.cnf
/usr/share/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
/usr/share/mysql-test/suite/rpl/t/rpl_rotate_logs.cnf
/usr/share/mysql-test/suite/rpl/t/rpl_000015.cnf
/usr/share/mysql-test/suite/rpl/my.cnf
/usr/share/doc/mysql-server-5.1.47/my-medium.cnf
/usr/share/doc/mysql-server-5.1.47/my-large.cnf
找到之后,复制一个出来
# cp /usr/local/mysql/support-files/my-large.cnf /etc/my.cnf
2. 打开my.cnf修改编码
#gedit /etc /my.cnf
在[mysqld]下和在[client]下分别添加一行
default_character_set=utf8
3. 重启mysql
4. 重新建立数据库,重新录入数据!
# find / -name *.cnf
/usr/share/mysql-test/include/default_mysqld.cnf
/usr/share/mysql-test/include/default_my.cnf
/usr/share/mysql-test/include/default_ndbd.cnf
/usr/share/mysql-test/std_data/ndb_config_mycnf1.cnf
/usr/share/mysql-test/std_data/bug15328.cnf
/usr/share/mysql-test/std_data/ndb_config_mycnf2.cnf
/usr/share/mysql-test/suite/ndb/my.cnf
/usr/share/mysql-test/suite/federated/my.cnf
/usr/share/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf
/usr/share/mysql-test/suite/rpl_ndb/my.cnf
/usr/share/mysql-test/suite/rpl/rpl_1slave_base.cnf
/usr/share/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
/usr/share/mysql-test/suite/rpl/t/rpl_rotate_logs.cnf
/usr/share/mysql-test/suite/rpl/t/rpl_000015.cnf
/usr/share/mysql-test/suite/rpl/my.cnf
/usr/share/doc/mysql-server-5.1.47/my-medium.cnf
/usr/share/doc/mysql-server-5.1.47/my-large.cnf
找到之后,复制一个出来
# cp /usr/local/mysql/support-files/my-large.cnf /etc/my.cnf
2. 打开my.cnf修改编码
#gedit /etc /my.cnf
在[mysqld]下和在[client]下分别添加一行
default_character_set=utf8
3. 重启mysql
4. 重新建立数据库,重新录入数据!