mysql无法远程连接问题(ERROR 1045 (28000): Access denied for user 'root')
mysql版本 : 8.0.21
使用mysql 作为nextcloud的数据库。之前使用挺正常的,因为被黑客勒索过一次,重新启动了一个mysql的docker镜像。
结果数据库配置老是失败,nextcloud提示无法访问mysql。

进入docker 镜像查看,使用mysql -p 命令,可以正常登陆,密码也是正确的。
但是使用mysql -h 172.17.0.7 -p 命令,则会提示无法访问。

于是,查看root权限,提示报错。似乎没有配置远程访问的权限。
ERROR 1141 (42000): There is no such grant defined for user 'root' on host '%'

尝试配置远程访问权限,报错。
grant all privileges on *.* to 'root'@'172.17.0.%' identified by '123456';

上网查了,才知道,mysql 8以后的版本,不支持这种语法,可以分两步进行。
1,create user 'root'@'172.17.0.%' identified by '123456';
2,grant all privileges on *.* to 'root'@'172.17.0.%' with grant option;

配置成功后,使用mysql -h xxx -p 尝试访问,成功。

到一步,mysql数据库就可以支持远程访问了,而且root帐号仅支持172.17.0.x网段的远程。
mysql无法远程连接问题(ERROR 1045 (28000): Access denied for user 'root')的更多相关文章
- mysql登录报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
在MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问 对于出现拒绝访问root用户的解决方案错 ...
- MySQL在登陆时出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)错误
错误显示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决方案: 1.找到配 ...
- CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解决方法
1.停用mysql服务:# /etc/rc.d/init.d/mysqld stop 2.输入命令:# mysqld_safe --user=mysql --skip-grant-tables --s ...
- MySQL for Linux错误: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
参考链接:http://www.cnblogs.com/gumuzi/p/5711495.html
- 解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Red Hat Enterpris ...
- 转-解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Red Hat Enterpr ...
- Ubuntu下MySQL报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
在Ubuntu下 想要登录mysql数据库 root@JD:~# mysql -uroot -p 报错 ERROR 1045 (28000): Access denied for user 'root ...
- mysql安装启动 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
首次安装mysql 启动 mysql -uroot 以下错误: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using ...
- yum 安装 Mysql error ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 开启远程连接 修改登入密码 忘记root密码 配置防火墙规则 随手mark
yum 安装 MYsql: yum install mysql mysql-server mysql-devel -y 1.1 登入报错: ERROR 1045 (28000): Acc ...
- win10连接mysql提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
win10中cmd连接mysql提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YE ...
随机推荐
- Python基础-异常
异常捕获 常见异常类型 Exception:顶级异常类,大部分异常类都是它的子类.SyntaxError:语法错误TypeError:类型错误ValueError:值错误NameError:找不到名称 ...
- node的async模块
废话不多说,直接开始 这个模块有几种方法.分别用于的不通的情况自己喜欢怎么用就怎么用 第一个方法,series 这个方法用于串行切无关联.什么意思那就是,里面的方法是一个一个执行的,每一个方法相互不 ...
- UUID字符串使用
UUID字符串使用 1.可以生成唯一的字符串标示,在发送请求中可能会用到 function uuid(num) { var s = []; var hexDigits = "01234567 ...
- 小书MybatisPlus第7篇-代码生成器的原理精讲及使用方法
本文是本系列文章的第七篇,前6篇访问地址如下: 小书MybatisPlus第1篇-整合SpringBoot快速开始增删改查 小书MybatisPlus第2篇-条件构造器的应用及总结 小书Mybatis ...
- vue学习 `${HH}-${mm}-${dd}` 按键修饰符
vue 有一种拼接字符串的规范写法 //键盘 Tab 键 上边的键 英文输入状态 然后采用类似EL表达式${变量}return `${}:${}:${}` //有时候我们经常在输入完密码之后,按回车E ...
- 人车识别实验丨华为ModelArts VS 百度Easy DL硬核体验
摘要:想了解时下流行的自动驾驶相关AI模型吗?接下来就用华为云的ModelArts和百度的Easy DL带你体验一下AI平台是怎么进行模型训练的. 华为ModelArts自动学习 VS 百度Easy ...
- Python元组运算符
Python元组运算符: len(元组名): 返回元组对象的长度 # len(元组名): # 返回元组对象的长度 tuple_1 = (1,4,5,2,3,6) print(len(tuple_1)) ...
- pandas | DataFrame基础运算以及空值填充
本文始发于个人公众号:TechFlow,原创不易,求个关注 今天是pandas数据处理专题的第四篇文章,我们一起来聊聊DataFrame中的索引. 上一篇文章当中我们介绍了DataFrame数据结构当 ...
- Kafka和SpringBoot
事先必备: kafka已安装完成 1.目录结构 2.父pom <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns ...
- PHP preg_replace_callback_array() 函数
preg_replace_callback_array 函数执行一个正则表达式搜索并且使用一个回调进行替换.高佣联盟 www.cgewang.com 该函数在 PHP7+ 版本支持. 语法 mixed ...