刚刚发现网址打不开,数据库连接报如下错误:

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

这个错我之前遇到过,当时是因为数据库刚创建没有给访问权限,可现在都运营几个月了,突然又遇到了这个报错。

在网上查了一下,原来是mysql中root用户的密码被该了。。。。。

 

之后通过一下步骤重新定义了用户密码就好了:

#/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables &
mysql
mysql> use mysql;
mysql> UPDATE user SET password=password("新密码") WHERE user='root';   
mysql> flush privileges;
mysql> exit;                         

相关文章:

  • 2021-08-20
  • 2021-09-16
  • 2021-09-26
  • 2022-01-09
  • 2021-08-05
  • 2021-09-27
  • 2022-01-05
猜你喜欢
  • 2022-01-14
  • 2021-12-25
  • 2021-06-01
  • 2021-11-04
  • 2022-12-23
  • 2021-11-18
  • 2021-10-01
相关资源
相似解决方案