MySQL 说:文档 #1045 - 用户 'root'@'localhost' 访问被拒绝(使用密码:NO)

2021-11-20 00:00:00 xampp mysql phpmyadmin mysql-error-1045

我安装了 xampp,但是当我尝试运行它时出现错误:

I installed xampp,but when I tried to run it I got an error as thus:

错误

MySQL 说:文档

您的配置中定义的 controluser 连接失败.phpMyAdmin 尝试连接 MySQL 服务器,服务器拒绝连接.您应该检查配置中的主机、用户名和密码,并确保它们与 MySQL 服务器管理员提供的信息相对应.

Connection for controluser as defined in your configuration failed. phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

我尝试在互联网上搜索解决方案,但仍然无法解决我的问题.我已经在config.inc.php文件中检查过我是否使用了密码,但我没有使用任何密码.另外,当我尝试使用密码访问时,我仍然无法解决这个问题.

I tried to search on internet for a solution, but I still can't fix my problem. I have already checked whether I used a password or not in config.inc.php file but i have not used any password.Also, when i try to access with a password, I still can't solve this problem.

我希望有人能帮助我..谢谢

I hope anyone can help me. .thank you

推荐答案

我在 phpMyAdmin 中更改了 root 用户的密码后遇到了这个问题.我对编程一无所知,但我通过执行以下操作解决了它:

I had this problem after changing the password for the root user in phpMyAdmin. I know nothing about programming but I solved it by doing the following:

  1. 转到文件 C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php(如果你没有使用 Wamp 服务器)

  1. Go to file C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php (I guess you would replace "wamp" with the name of your server if you're not using Wamp Server)

找到行 $cfg['Servers'][$i]['password']='' 并将其更改为

Find the line $cfg['Servers'][$i]['password']='' and change this to

$cfg['Servers'][$i]['password']='NO'

  • 再次尝试打开 phpMyAdmin,希望消息现在显示为用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)

  • Try opening phpMyAdmin again, and hopefully the message will now read "Access denied for user 'root'@'localhost' (using password: YES)

    现在将上面一行中的密码更改为您的密码"(无论您之前设置为什么)

    Now change the password in the above line to 'yourpassword' (whatever you had set it to before)

    希望这对某人有所帮助.

    Hope this helps somebody.

  • 相关文章