[摘要]+--------------------------+----------------------------+8 rows in set (0.01 sec)发现不是utf-8编码9.修改mys...
+--------------------------+----------------------------+
8 rows in set (0.01 sec)
发现不是utf-8编码
9.修改mysql编码
退出mysql,退出docker
mysql> exit
Bye
root@8b83a30acbf8:/# exit
exit
root@val-linux:/home/val/docker/mysql1#
修改my.cnf配置文件
root@val-linux:/home/val/docker/mysql1# vim conf/my.cnf
按i进入编辑模式
加入
[client] default-character-set=utf8
[mysql] default-character-set=utf8
[mysqld] character-set-server=utf8 1
esc :wq! 保存退出
10.重启docker的mysql再次查看编码
root@val-linux:/home/val/docker/mysql1# docker stop mysql1
mysql1
root@val-linux:/home/val/docker/mysql1# docker start mysql1
mysql1
root@val-linux:/home/val/docker/mysql1# docker exec -it mysql1 env LANG=C.UTF-8 bash
root@8b83a30acbf8:/# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.36 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like '%character%';
+--------------------------+----------------------------+
关键词:mysql5.6在ubuntu下的docker中安装的办法详细说明