设为首页 加入收藏

TOP

Docker创建MySQL镜像并成功进行远程连接
2018-12-19 00:08:57 】 浏览:85
Tags:Docker 创建 MySQL 成功 进行 远程 连接

拉取成功可以验证一下


到这里我们查看容器运行状态:


$ sudo docker ps


可以看到容器的简写ID,容器的源镜像,创建时间,状态,端口映射信息,容器名字等。


使用navicat远程连接,这里碰到几个问题


首先这个IP肯定不是localhost,然后以为是mysql容器的IP


结果是:172.17.0.2
但是还是连接不上


192.168.99.100


这个可以连接


结论:


原因:由于myslq8不支持动态修改密码验证方式
解决方案:


3.修改配置


然后可以进入容器的命令行模式,接着修改 /etc/mysql/my.cnf 文件即可


If /my/custom/config-file.cnf is the path and name of your custom configuration file, you can start your mysql container like this (note that only the directory path of the custom config file is used in this command):


This will start a new container some-mysql where the MySQL instance uses the combined startup settings from /etc/mysql/my.cnf and /etc/mysql/conf.d/config-file.cnf, with settings from the latter taking precedence.


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇CentOS 6 安装 MySQL 8.0.x 下一篇Docker搭建MongoDB

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目