解决Docker容器中Mysql中文乱码问题

进入容器,修改/etc/mysql/my.cnf

添加如下配置

[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=utf8

[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
character-set-server=utf8

[mysql]
no-auto-rehash
default-character-set=utf8

重启容器

你可能感兴趣的:(Linux,linux)