红联Linux门户
Linux帮助

ubuntu15.04 mysql字符集修改

发布时间:2015-10-27 09:42:26来源:linux网站作者:阿莱士多拉

一、修改之后默认的字符集编码

1.进入mysql shell​

sudo mysql -u root -p

2.查看mysql 字符集

show variables like 'character%'

ubuntu15.04 mysql字符集修改


二、操作步骤

1.修改mysql.cnf

命令: sudo vi /etc/mysql/conf.d/mysql.cnf

​在 [mysql]下添加如下一行

default-character-set=utf8​

ubuntu15.04 mysql字符集修改

2.修改mysqld.cnf

命令:sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf

在​[mysqld]下添加如下一行

character-set-server=utf8

ubuntu15.04 mysql字符集修改


三、重启系统

命令 sudo reboot

ubuntu15.04 mysql字符集修改


Linux编译安装MySQL5.6及修改字符集:http://www.linuxdiyf.com/linux/12546.html

mysql创建utf-8字符集数据库:http://www.linuxdiyf.com/linux/14401.html

十分钟搞清字符集和字符编码:http://www.linuxdiyf.com/linux/9476.html

MySQL字符集GBK转换到UTF8:http://www.linuxdiyf.com/linux/11500.html

Linux字符集的问题:http://www.linuxdiyf.com/linux/1459.html