标签:end default socket har alt dir general sql efault
mysql,发现都是乱码,一堆问号,如下图:
查看mysql编码
需要修改mysql编码,打开/etc/my.cnf 文件
在下边添加如下行
[client] default_character_set=utf8 [mysqld] collation_server = utf8_general_ci character_set_server = utf8
修改后的/etc/my.cnf如下:
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid [client] default_character_set=utf8 [mysqld] collation_server = utf8_general_ci character_set_server = utf8
再查看如下
已经修改过来了,重启, 再继续查询,能正常显示中文汉字,搞定。
标签:end default socket har alt dir general sql efault
原文地址:https://www.cnblogs.com/kumufengchun/p/10186741.html