Access denied for user ‘root‘@‘localhost‘ (using password: NO)
程序员文章站
2022-06-22 20:33:07
1.首先结束mysql进程,利用ps aux | grep mysql 得到进程ID号2.kill ID号,结束进程3.mysqld --skip-grant-tables或mysqld_safe --user=mysql --skip-grant-tables --skip-networking&4.然后,再开一个终端,输入mysql -u root mysql5.进去后,执行UPDATE user SET Password=PASSWORD('my_password') wh...
1.首先结束mysql进程,利用ps aux | grep mysql 得到进程ID号
2.kill ID号,结束进程
3.mysqld --skip-grant-tables或
mysqld_safe --user=mysql --skip-grant-tables --skip-networking&
4.然后,再开一个终端,输入mysql -u root mysql
5.进去后,执行
UPDATE user SET Password=PASSWORD('my_password') where USER='root';
FLUSH PRIVILEGES;
6.退出,重启mysql,然后你再运行mysql -u root -p输入你的密码,应该就OK了
本文地址:https://blog.csdn.net/weixin_45706762/article/details/107674350
上一篇: 网络连接相关的知识
下一篇: MongoDB基础操作
推荐阅读
-
linux mysql忘记密码的多种解决或Access denied for user 'root'@'localhost'
-
ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)
-
MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)问题的解决
-
连接本地数据库出现:1045 - Access denied for user 'root'@localhost'(using pass
-
ERROR 1045: Access denied for user: root@localhost (Using password: NO)
-
win10下MySQL 8.0登录Access denied for user‘root’@‘localhost’ (using password: YES)问题的解决方法
-
ERROR 1045 (28000): Access denied for user ''root''@''localhost'' (using passwor
-
Linux连接mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)的解决
-
MySQL密码正确却无法本地登录-1045 Access denied for user 'root'@'localhost' (using password:YES
-
Linux连接mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)的解决