盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

mysql5.6在ubuntu下的docker中安装的方法详细说明

时间:2025/3/3作者:未知来源:盾怪网教程人气:

[摘要]+--------------------------+----------------------------+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中安装的办法详细说明




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版