"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > How to Fix \"Access Denied for User \'Root\'@\'localhost\'\" Error in phpMyAdmin?

How to Fix \"Access Denied for User \'Root\'@\'localhost\'\" Error in phpMyAdmin?

Published on 2024-11-08
Browse:749

How to Fix \

How to Resolve "Access denied for user 'root'@'localhost'" Error in phpMyAdmin

If you encounter the "Access denied for user 'root'@'localhost' (using password: NO)" error while accessing phpMyAdmin, it often indicates that the password for the 'root' user has been incorrectly set or removed.

To fix this issue, follow these steps:

  1. Locate the config.inc file: Navigate to the following directory on your server: C:\wamp\apps\phpmyadmin[version number] (e.g., C:\wamp\apps\phpmyadmin3.5.1).
  2. Edit the config.inc file: Find the line: $cfg['Servers'][$i]['password'] = "";
  3. Set the root password: Replace the empty string with your desired root password. For example: $cfg['Servers'][$i]['password'] = 'rootpassword';
  4. Save and restart phpMyAdmin: Save the config.inc file and restart phpMyAdmin.

Once you have set the correct password, you should be able to access phpMyAdmin without receiving the "Access denied" error. Note that the root password must match the password set in the MySQL configuration file (usually my.ini or my.cnf).

If the above steps do not resolve the issue, you may need to consider other factors such as firewall settings, MySQL user permissions, or file permissions.

Release Statement This article is reprinted at: 1729303217 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3