首页 > MySQL远程登录,修改登录权限出错

MySQL远程登录,修改登录权限出错

在虚拟机里安装了MySQL(CentOS6.3 + MySQL5.5.30),根据网上搜索,要想实现远程登录,需要授予权限,通过root登录mysql,然后输入

grant all privileges on *.* to ‘dev’@’localhost′ identified by '123456' with grant option;

结果显示:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

我确定我输入的root密码是正确的,因为登录时使用了密码登录

mysql -u root -p

另外,我的user表里没有user为空的记录

select user,host from mysql.user

+---

+

------------+
| user | host |
+---

+

------------+
| dev | % |
| root | 192.168.242.1 |
| root | localhost |
+---

+

------------+


问题解决,是设置之后没有进行flush操作:flush privileges;

【热门文章】
【热门文章】