whereis mysql
ubuntu@VM-0-14-ubuntu:~$ whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /etc/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
cd /etc/mysql
ls
conf.d debian.cnf debian-start my.cnf my.cnf.fallback mysql.cnf mysql.conf.d
vim my.cnf
[client]
default-character-set = utf8
[mysqld_safe]
default-character-set = utf8
[mysqld]
init_connect=‘SET collation_connection = utf8_unicode_ci‘
init_connect=‘SET NAMES utf8‘
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
[mysql]
default-character-set=utf8
:wq
/etc/init.d/mysql restart
原文:https://www.cnblogs.com/mengxiaoleng/p/13456076.html