mysql错误:access denied for user 'root'@'%' to reb

使用Naicat Premium远程连接的mysql上面创建了一个新数据库和新的用户后,给该用户添加这个新数据库权限时出现:access denied for user 'root'@'%' to database xxxx的提示。

错误的原因是root用户在远程连接的MYSQL上面,没有这个新数据库的授权。在本地使用mysql应该不存在这个问题。

解决方法,执行授权:

grant all PRIVILEGES on xxxx.* to root@'%'  identified by 'password' with grant option;

xxxx为创建的数据库,password为root的密码。请按实际要求进行更改。

猜你喜欢

转载自5keit.iteye.com/blog/2333636