一 问题描述

[email protected]‘%’用户授予的all权限,但是用该用户远程登录数据库给其他用户授权时报错:

MariaDB [(none)]> GRANT REPLICATION SLAVE ON *.*  TO 'ReplUser'@'192.168.144.10';
ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)

二 出错原因

远程root用户的grant_priv是关闭状态:

MariaDB远程root用户无法授权

三 解决办法

将远程root用户的grant_priv改为Y:

MariaDB [(none)]> update mysql.user set grant_priv='Y' where user='root' and host='%';
Query OK, 1 row affected (0.002 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.003 sec)
重新用该远程root用户登录,进行授权,不再报错了。

 

相关文章:

  • 2021-05-27
  • 2021-09-07
  • 2021-08-11
  • 2022-12-23
  • 2021-12-08
  • 2022-01-04
  • 2021-10-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2021-04-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案