设置mysql在linux下字符集为utf8,解决可能出现的乱码

找到etc/my.conf

 

2. 修改mysql字符集

执行下列命令:# cd /usr/share/mysql

# cp my-huge.cnf /etc/my.conf

# vi /etc/my.cnf

找到客户端配置[client] 

在下面添加 

default-character-set=utf8

在找到[mysqld] 

添加default-character-set=utf8
以及在文件末尾添加

[server]

default-character-set=utf8

[database]

default-character-set=utf8

3.

innodbinnodb_buffer_pool_size = 2560M

innodb_log_buffer_size  = 8M

innodb_flush_log_at_trx_commit  = 2

innodb_thread_concurrency   = 16

innodb_flush_method = O_DIRECT
I tried to delete /var/lib/mysql/ib_logfile0 and restart mysqld but it still failed. It now shows the following in error log.

posted @ 2010-11-09 08:45  Rio·Yang  阅读(726)  评论(0编辑  收藏  举报