Grant的时候报错的解决:Access denied for user 'root'@'localhost' (using password: YES)

时间:2014-07-01 07:08:47   收藏:0   阅读:461


mysql> grant all on *.* to ‘root‘@‘192.168.1.1‘ identified by ‘password‘;

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


确认方式(查看是否有grant all 没有就是权限不全):

mysql>SHOW GRANTS FOR‘root‘@‘localhost‘;
+---------------------------------------------------------------------+
|Grants forroot@localhost                                           |
+---------------------------------------------------------------------+
|GRANTALLPRIVILEGES ON*.*TO‘root‘@‘localhost‘WITHGRANTOPTION


解决方法:运行bin下的mysql_upgrade,再重启数据库。

(运行前,最好先备份原来的数据库)

/usr/bin/mysql_upgrade -uroot -p



Grant的时候报错的解决:Access denied for user 'root'@'localhost' (using password: YES),布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!