折腾一下午MYSQL
character_set_results的值一直是latin1
1 修改 /etc/my.cnf
在mysqld 下加入 default-character-set=utf8
重启mysql 发现不成功
2 修改 /etc/my.cnf
增加
[client]
default-character-set=utf8
重启 成功
character_set_results修改为utf8
下边是最终修改后的结果,
然后重建库表 解决乱码问题
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
default-character-set=utf8
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
default-character-set=utf8
character_set_results的值一直是latin1
1 修改 /etc/my.cnf
在mysqld 下加入 default-character-set=utf8
重启mysql 发现不成功
2 修改 /etc/my.cnf
增加
[client]
default-character-set=utf8
重启 成功
character_set_results修改为utf8
下边是最终修改后的结果,
然后重建库表 解决乱码问题
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
default-character-set=utf8
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
default-character-set=utf8