Ubuntu17+下安装Mysql5.7+配置字符集

来源:互联网 发布:认知网络 运筹优化 编辑:程序博客网 时间:2024/06/07 08:04

Ubuntu17+下安装Mysql5.7+配置字符集

来源:

http://www.linuxidc.com/Linux/2016-07/133128.htm
https://www.cnblogs.com/ClassNotFoundException/p/6090357.html

安装:

~# sudo apt-get install mysql-server~# apt-get install mysql-client~# sudo apt-get install libmysqlclient-dev

更改字符集:
低版本mysql的字符集信息都存在/etc/my.cnf下,由于5.7+版本更换了地方,所以换成以
~# vim /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]下更改内容为:

...... [mysqld] ...... skip-external-locking character-set-server=utf8 ......

接下来对下面文件进
~# vim /etc/mysql/conf.d/mysql.cnf

[mysqld]下加入以下内容:

[mysql] default-character-set=utf8

重启服务器
~# serviece mysql restart

最后进入mysql查看即可

mysql> \s