linux的redhat版上mysql字符乱码解决方案

linux上安装了mysql服务,默认的字符编码不是utf8,所以会出现中文乱码。解决方案如下:

1、修改文件/etc/my.cnf,在mysqld配置的最后一行加上character-set-server=utf8

     vi /etc/my.cnf

2、重启mysqld服务

service mysqld restart

3、字符中文乱码解决好了

原文地址:https://www.cnblogs.com/javayuan/p/5248879.html