navicat 提示“1045 access denied for user 'root'@'localhost' ”解决方法

cmd命令行切换到MySQLbin目录下,

mysqld --skip_grant_tables;//跳过权限验证。

登录mysql后

mysql -u root -p;         //mysql首次登录默认密码为空。

方法一:

mysql>updatemysql.user set authentication_string=password('root') where user='root';

mysql> flushprivileges;

mysql> quit;

 

方法二:(可用)

登录mysql后,

mysql>alteruser 'root'@'localhost' identified by 'root';

 

 

方法三:

登录mysql

mysql>setpassword for 'root'@'localhost'=password('root');


转载于:https://blog.csdn.net/liufuwu1/article/details/76794695

猜你喜欢

转载自blog.csdn.net/chongchong247619000/article/details/80518867
今日推荐