docker -mysql服务设置远程连接 解决1251 client does not support ..问题
前提:
安装MYSQL实例
docker pull mysql
启动mysql(做了端口映射)
[root@localhost ~]# docker run -p 3306:3306 --name mysql02 -e MYSQL_ROOT_PASSWORD=123456 -d mysql
5cf11b6647da2f4d301020934cb8ef750d7215d3c25fb81a56d30fbfd1a24530
言归正传:解决方案如下:
在docker创建mysql容器后使用Navicat远程连接事报错:

操作起来:
先查看user表中的信息:
select host,user,plugin,authentication_string from mysql.user;

host 列中的 % 表示不限制IP ; localhost表示的是本机使用 plugin非mysql_native_password 则需要修改密码
alter user 'root'@'% 'IDENTIFIED WITH mysql_native_password BY '123';
// (注意SQL语句最后加上 ;) //其中 root用户 密码为123 (按照你的用户 密码对应设置既可) //最后刷新生效 flush privileges;
[root@localhost ~]# docker run -it --link mysql02:mysql --rm mysql sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$M
YSQL_ENV_NYSQL_ROOT_PASSWORD"'
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.11 MySQL Community Server - GPL Copyright (c) 2000, 2018, 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> select host,user,plugin,authentication_string from mysql.user;
+-----------+------------------+-----------------------+------------------------------------------------------------------------+
| host | user | plugin | authentication_string |
+-----------+------------------+-----------------------+------------------------------------------------------------------------+
| % | root | caching_sha2_password | $A$005$*@A<}'C_C7%M4i3c3Qmow5Vpi7OWL0v..KqLCIzI5ai7tvBGkXxE7K6 |
| localhost | mysql.infoschema | mysql_native_password | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| localhost | mysql.session | mysql_native_password | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| localhost | mysql.sys | mysql_native_password | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| localhost | root | caching_sha2_password | $A$005$vU(<0Km/fNjY\IW8Ma8ktz5xLyByDbtiEVsGqaIa5B/JzXfuXe9ez0d15VC |
+-----------+------------------+-----------------------+------------------------------------------------------------------------+
5 rows in set (0.03 sec)
mysql> Alter user 'root'@'% 'IDENTIFIED WITH mysql_native_password BY '123';
Query OK, 0 rows affected (0.06 sec) mysql> flush privileges;
docker -mysql服务设置远程连接 解决1251 client does not support ..问题的更多相关文章
- mysql服务设置远程连接 解决1251 client does not support ..问题
在docker里面创建mysql容器后设置的密码在远程主机连接时候出现错误: 一.如果是在docker里面安装的mysql镜像则需要先进入mysql里面:参考上一篇:https://www.cnblo ...
- docker部署mysql远程连接 解决1251 client does not support ..
现象:用虚拟机上Docker启动mysql之后无法在本地安装的navicat上远程连接已启动的mysql,错误截图: 原因:mysql 8.0 默认使用 caching_sha2_password 身 ...
- mysql服务设置远程连接
一.前期准备 1.虚拟机/物理机 mysql环境(非本机)2.本机 navicat软件(验证远程连接) 二 .mysql配置 1.在远程主机的本机 使用root用户连接mysql mysql ...
- linux下安装mysql并设置远程连接
腾讯云环境为Centos7.4 mysql版本为5.6 本次安装使用yum安装 检查是否已有mysql: yum list installed | grep mysql 下载yum源文件: wge ...
- mysql数据库设置远程连接权限
原文 问题现象 mysql 安装完毕,本机登录正常,在远程输入正确账号密码登录连接时报错如下 问题原因 远程IP没有登录权限,root用户默认只能在localhost也就是只能在本机登录,需要设置允许 ...
- MySQL数据库无法远程连接的解决办法
远程登陆数据库的时候出现了下面出错信息: ERROR 2003 (HY000): Can't connect to MySQL server on 'xxx.xxx.xxx.xxx', 经过今天下午的 ...
- MySQL不支持远程连接的解决办法
如果mysql不支持远程连接,会出现提示:错误代码是1130,ERROR 1130: Host * is not allowed to connect to this MySQL server ,解决 ...
- Mysql 修改密码和设置远程连接
[参考文章]:mysql修改root密码和设置权限 1. 修改密码 1.1 set password 登录mysql set password for 用户名@localhost = password ...
- 安装好mysql后允许远程连接
安装好mysql后允许远程连接 http://blog.sina.com.cn/s/blog_3eba8f1c0100tsox.html http://blog.csdn.net/zxyvb/arti ...
随机推荐
- bootstrap-treeview简单使用
废话不多说,直接上干干货. 1.bootstrap-treeview Github网址:https://github.com/jonmiles/bootstrap-treeview 2.使用要求: & ...
- MySQL5.6主从复制方案
MySQL5.6主从复制方案 1.主备服务器操作 环境:CentOS 6.3/6.4 最小化缺省安装,配置好网卡. 安装MySQL前,确认Internet连接正常,以便下载安装文件. # 新增用户组 ...
- ACM-ICPC 2016 Qingdao Preliminary Contest
A I Count Two Three I will show you the most popular board game in the Shanghai Ingress Resistance T ...
- 什么是Monad?
为了理解什么是Monad,最好需要了解什么是Monoid.这两篇互为姐妹篇,因为Monad的定义是:A monad is just a monoid in the category of endofu ...
- 由于webpack-cli版本问题造成的错误
The CLI moved into a separate package: webpack-cli Please install 'webpack-cli' in addition to webpa ...
- 泛泰A820L (高通MSM8660 cpu) 3.4内核的CM10.1(Android 4.2.2) 測试版第二版
欢迎关注泛泰非盈利专业第三方开发团队 VegaDevTeam (本team 由 syhost suky zhaochengw(z大) xuefy(大星星) tenfar(R大师) loogeo cr ...
- iOS 7 UI 过渡指南 - 支持续 iOS 6(iOS 7 UI Transition Guide - Supporting iOS 6)
iOS 7 UI Transition Guide Preparing for Transition Before You Start Scoping the Project Supporting i ...
- Java之——删除ArrayList中的反复元素的2种方法
转载请注明出处:http://blog.csdn.net/l1028386804/article/details/47414935 ArrayList是Java中最经常使用的集合类型之中的一个.它同意 ...
- 直播聊天室,点亮效果,jquery实现
1.css #like_area img{ width: 30px; height: 30px; position: absolute; bottom: 100px; left: 60%; margi ...
- Android 数据库框架总结,总有一个适合你!
一:OrmLite 简述: 优点: 1.轻量级:2.使用简单,易上手:3.封装完善:4.文档全面.缺点:1.基于反射,效率较低(本人还没有觉得效率低):2.缺少中文翻译文档 jar包 地址:http: ...