Linux连接mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)的解决方法
程序员文章站
2022-04-15 20:13:36
前言
最近在linux连接mysql /usr/local/mysql/bin/mysql -uroot -p
输入密码出现access denied for user...
前言
最近在linux连接mysql /usr/local/mysql/bin/mysql -uroot -p
输入密码出现access denied for user 'root'@'localhost'(using password: yes)
错误。下面话不多说了,来一起看看详细的解决方法吧
解决办法:
1.先停止mysql 服务
service mysqld stop
2.进入mysql安装目录bin/ 使用safe模式,进行重启:
./mysqld_safe --skip-grant-tables
3.使用root账户,无密码登录,修改root用户密码
mysql -u root use mysql update user set password=password("你的密码") where user = 'root';
4.重启mysql,正常登录
service mysqld restart 重启
/usr/local/mysql/bin/mysql -uroot -p
然后输入刚才重置的密码
完成,连接成功!
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对的支持。
下一篇: haproxy介绍与部署
推荐阅读
-
win10下MySQL 8.0登录Access denied for user‘root’@‘localhost’ (using password: YES)问题的解决方法
-
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)的解决
-
java访问数据库被拒绝,不能连接数据库ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
-
Linux连接mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)的解决方法
-
Access denied for user 'root'@'localhost' (using password:YES) Mysql5.7
-
Eclipse使用jdbc连接MySql数据库报:java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
-
Web项目打成war包部署到tomcat时报MySQL Access denied for user 'root'@'localhost' (using password: YES)错误解决方案(推)
-
mysql:mysql error:Access denied for user 'root'@'localhost' (using password: YES)