MYSQL8给新用户grant权限报错的解决方法.241202

​MYSQL8用客户端创建用户,无法grant,报错:Access denied for user ‘root‘@‘xxx.xxx.xxx.xxx‘ (using password: YES) 。

解决方法:

误区:不要相信网上各种传说,比如update root账号,没用。

update mysql.user set Grant_priv='N',Super_priv='Y' where user = 'root' and host = 'xx.xx';

最正确的办法:

到服务器,本地登录 root@localhost账号,然后,grant权限,即可。

grant select on *.* to 'onlyread'@'%';
posted @ 2025-01-03 16:21  中国的Amadeus  阅读(162)  评论(0)    收藏  举报