欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

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

发布时间:2025/3/11 编程问答 24 豆豆
生活随笔 收集整理的这篇文章主要介绍了 ERROR 1045 (28000): Access denied for user root@localhost (using password: NO) 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

Linux下mysql的安装,真是不同Linux环境,各种问题。


步骤:

1、暂停mysql服务

service mysqld stop


2、设置mysql模式

# mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 


3、clone session,新窗口

# mysql -u root mysql 
mysql> UPDATE user SET Password=PASSWORD('新密码') where USER='root'; 
mysql> FLUSH PRIVILEGES; 

mysql> quit 


4、重启mysql服务

service mysqld restart


# mysql -uroot -p 
Enter password: <输入新设的密码newpassword> 
mysql> 


总结

以上是生活随笔为你收集整理的ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。