you need (at least one of) the RELOAD privilege(s) for this operation
2024-10-29 09:40:28 阅读次数:15
问题:
新搭建的mysql5.6.20,默认没有密码直接输入mysql回车进行登录:
mysql
将root@'localhost'改为root@'%'
update mysql.user set host='%' where user='root' and host='localhost';
退出重新登录:
mysql -uroot -p123456
会直接报错账号密码错误,这时候直接输入mysql回车还可以登录
再执行:
select user,host from mysql.user;
直接报错:
Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
解决办法:
因为root@'localhost' 改为root@'%'
可以使用mysql -uroot -p123456 -h 192.168.10.130登录
然后重新创建root@'localhost'账号
grant all on *.* to root@'localhost' identified by '123456' with grant option;
flush privileges;
这样子既可以远程登录root也可以本机直接登录
猜想:
将root@'localhost' 改为root@'%',host里面没有做业务ip和主机名之间的映射
版权声明:本文内容来自第三方投稿或授权转载,原文地址:https://blog.51cto.com/u_13236892/6038568,作者:哭泣的馒头,版权归原作者所有。本网站转在其作品的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如因作品内容、版权等问题需要同本网站联系,请发邮件至ctyunbbs@chinatelecom.cn沟通。
上一篇:Prometheus监控之报错Error on ingesting out-of-order samples
下一篇:集合论基础 - 离散数学系列(一)