远程连接Docker中的mysql报错1251-Client does not support authentication protocol...

解决方案:

  1.   通过已经建立好的mysql容器输入命令进入mysql
  2. docker run -it --link 容器名:mysql mysql镜像名 sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
  3. 修改用户密码

          ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '新密码';

         刷新:flush privileges;

例:

CentOS7 安装docker 解决启动不了的问题

使用yum install docker安装完后启动不了

[root@apptest ~]# service docker start

Redirecting to /bin/systemctl start docker.service

[root@apptest ~]# curl -fsSL https://get.docker.com/ | sh

+ sh -c 'sleep 3; yum -y -q install docker-engine'

警告:/var/cache/yum/x86_64/7/docker-main-repo/packages/docker-engine-selinux-1.10.2-1.el7.centos.noarch.rpm: 头V4 RSA/SHA512 Signature, 密钥 ID 2c52609d: NOKEY

docker-engine-selinux-1.10.2-1.el7.centos.noarch.rpm 的公钥尚未安装

导入 GPG key 0x2C52609D:

 用户ID   : "Docker Release Tool (releasedocker) <docker@docker.com>"

 指纹    : 5811 8e89 f3a9 1289 7c07 0adb f762 2157 2c52 609d

 来自    : https://yum.dockerproject.org/gpg

setsebool: SELinux is disabled.

+ sh -c 'docker version'

Client:

 Version:   1.10.2

 API version: 1.22

 Go version:  go1.5.3

 Git commit:  c3959b1

 Built:    Mon Feb 22 16:16:33 2016

 OS/Arch:   linux/amd64

Cannot connect to the Docker daemon. Is the docker daemon running on this host?

 

If you would like to use Docker as a non-root user, you should now consider

adding your user to the "docker" group with something like:

 

 sudo usermod -aG docker your-user

 

Remember that you will have to log out and back in for this to take effect!

 

[root@apptest ~]#

 

[root@apptest ~]# service docker start

Redirecting to /bin/systemctl start docker.service

[root@apptest ~]# docker images

REPOSITORY     TAG         IMAGE ID      CREATED       SIZE

[root@apptest ~]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值