MySQL数据库localhost的root用户登陆遭遇失败

问题:Access denied for user 'root'@'localhost' (using password: YES)

说明:当前mysql 可以通过公有IP及roo用户登录,只是不能通过命令行方式登录

解决:

user mysql;

select user, host from user;

grant all privileges on *.* to root@'localhost' identified by '密码'; 

 

参考地址:https://blog.csdn.net/u012467855/article/details/81266470

posted @ 2022-02-22 15:13  py卡卡  阅读(270)  评论(0编辑  收藏  举报