mysql 中文乱码解决方案

编辑my.cnf ,在mysqld ,client(没有自己写一个)加入default-character-set=utf8


[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-name-resolve
skip-grant-tables
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
default-character-set=utf8

[client]
default-character-set=utf8

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

天苍苍,野茫茫,风吹草底见牛羊

你可能感兴趣的:(mysql 中文乱码解决方案)