简体   繁体   English

使用PHPMyAdmin拒绝用户“root”@“localhost”访问

[英]Access denied for user 'root'@'localhost' with PHPMyAdmin

When I set the root password in PHPMyAdmin, I get this error: 当我在PHPMyAdmin中设置root密码时,我收到此错误:

#1045 - Access denied for user 'root'@'localhost' (using password: NO)

I can't open the PHPMyAdmin panel. 我无法打开PHPMyAdmin面板。 What am I doing wrong? 我究竟做错了什么?

Edit your phpmyadmin config.inc.php file and if you have Password, insert that in front of Password in following code: 编辑您的phpmyadmin config.inc.php文件,如果您有密码,请在以下代码中插入密码前面:

$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = '**your-root-username**';
$cfg['Servers'][$i]['password'] = '**root-password**';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

Here are few steps that must be followed carefully 以下是必须仔细遵循的几个步骤

  1. First of all make sure that the WAMP server is running if it is not running, start the server. 首先确保WAMP服务器在运行时运行,启动服务器。
  2. Enter the URL http://localhost/phpmyadmin/setup in address bar of your browser. 在浏览器的地址栏中输入URL http:// localhost / phpmyadmin / setup
  3. Create a folder named config inside C:\\wamp\\apps\\phpmyadmin, the folder inside apps may have different name like phpmyadmin3.2.0.1 在C:\\ wamp \\ apps \\ phpmyadmin中创建一个名为config的文件夹,应用程序内的文件夹可能有不同的名称,如phpmyadmin3.2.0.1

  4. Return to your browser in phpmyadmin setup tab, and click New server. 在phpmyadmin设置选项卡中返回浏览器,然后单击“新建服务器”。 新服务器

  5. Change the authentication type to 'cookie' and leave the username and password field empty but if you change the authentication type to 'config' enter the password for username root. 将身份验证类型更改为“cookie”并将用户名和密码字段保留为空,但如果将身份验证类型更改为“config”,请输入用户名root的密码。

  6. Click save 点击保存 保存

  7. Again click save in configuration file option. 再次单击配置文件选项中的保存。
  8. Now navigate to the config folder. 现在导航到config文件夹。 Inside the folder there will be a file named config.inc.php. 在文件夹中,将有一个名为config.inc.php的文件。 Copy the file and paste it out of the folder (if the file with same name is already there then override it) and finally delete the folder. 复制文件并将其粘贴到文件夹中(如果已存在同名文件,则覆盖它),最后删除该文件夹。
  9. Now you are done. 现在你完成了。 Try to connect the mysql server again and this time you won't get any error. 尝试再次连接mysql服务器,这次你不会收到任何错误。 --credits Bibek Subedi --credits Bibek Subedi

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 修复 phpMyAdmin 用户 'root'@'localhost' 拒绝访问的问题 - Fix Access denied for user 'root'@'localhost' for phpMyAdmin XAMPP PhpMyAdmin错误1045,“用户'root'@'localhost'的访问被拒绝 - XAMPP PhpMyAdmin Error 1045, "Access denied for user 'root'@'localhost' 在 ubuntu 上安装 phpmyadmin 后,用户“root”@“localhost”的访问被拒绝 - Access denied for user 'root'@'localhost' after installing phpmyadmin on ubuntu 用户root拒绝phpMyAdmin访问 - phpMyAdmin access denied for user root xampp localhost phpmyadmin 用户 'root'@'localhost' 访问被拒绝(使用密码:YES) - xampp localhost phpmyadmin Access denied for user 'root'@'localhost' (using password: YES) 用户“ @'localhost”的访问被拒绝(使用密码:NO)phpmyadmin - Access denied for user ''@'localhost' (using password: NO) phpmyadmin 我从 phpmyadmin 中删除了所有用户,现在它说'#1045 - 用户'root'@'localhost' 访问被拒绝(使用密码:NO)' - I deleted all the users from phpmyadmin and now it is saying '#1045 - Access denied for user 'root'@'localhost' (using password: NO)' Windows:#1045-用户'root'@'localhost'的访问被拒绝(使用密码:是)phpmyadmin - Windows: #1045 - Access denied for user 'root'@'localhost' (using password: YES) phpmyadmin 用户'root'@'localhost'的访问被拒绝(使用密码:NO) - Access denied for user 'root'@'localhost' (using password: NO) 无法连接:用户'root'@'localhost'的访问被拒绝 - Could not connect: Access denied for user 'root'@'localhost'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM