1044 - Access denied for user 'root'@'%' to database 'xahy-blog'

grant 创建了一个远程连接 root 权限账户,
准备再授权个对应数据库操作的账户时出现了 1044 错误。

[SQL]grant all privileges on xahy-blog.* to xahyRoot @"%" identified by "xahyRootJoC6Q"

[Err] 1044 - Access denied for user 'root'@'%' to database 'xahy-blog'

查询 grant 语法,
发现是创建 root 权限账户时未声明允许用户再将该权限授予其它用户,
重新创建一个 root 权限账户,正确的SQL语句应该是

grant all privileges on *.* to root01 @"%" identified by "root" WITH GRANT OPTION; 
flush privileges;

猜你喜欢

转载自blog.csdn.net/xianhenyuan/article/details/91850803