113资讯网:安装程序进入Admin后台出现:SQLSTATE[HY000] [1045] Access denied for user'root'@'localhost' (using password: YES)

时间:2024-11-30 15:35:01

113资讯网:安装程序进入Admin后台出现:SQLSTATE[HY000] [1045] Access denied for user'root'@'localhost' (using password: YES)

各项设置设置正确,就是出现这种原因!

1.config.inc.php解决办法:

  1. 修改phpMyAdmin的配置文件里的密码设置,进入phpMyAdmin的安装目录,找到config.inc.php配置文件
  2. 修改$cfg[‘Servers’][$i][‘password’]=’你的密码'.
  3. 保存退出,重启MYSQL服务,再次找开phpMyAdmin

2.mysql服务器解决方案:

  1. # cd /usr/local/mysql/bin
  2. # mysql -uroot -p
  3. # use mysql
  4. # update user set host ='%' where user ='root' and host='127.0.0.1';
  5. # flush privileges;

3.phpmyadmin解决方案:

  1. 首先你的服务器要先配置phpmyadmin;步骤如下:
  2. 1:登陆phpmyadmin;
  3. 2:选择mysql数据库,user表;
  4. 3.直接执行sql语句;
  5. update user set host ='%' where user ='root' and host='127.0.0.1';
  6. flush privileges;

4.重启mysql解决方案: