How to Resolve "Access denied for user 'root'@'localhost' for phpMyAdmin
This issue arises when you attempt to access phpMyAdmin via "localhost/phpmyadmin/" but encounter an error stating "Access denied for user 'root'@'localhost' (using password: NO)." Surprisingly, accessing it via "127.0.0.1/phpmyadmin/" seems to work without any issues.
To resolve this problem, delve into your config.inc file located at "C:wampappsphpmyadmin3.5.1." Specifically, seek the line "$cfg['Servers'][$i]['password'] =" and replace it with "$cfg['Servers'][$i]['password'] = 'Type your root password here'." Ensure that you input the correct root password in place of the placeholder "Type your root password here."
By implementing this change, you will restore the access privileges for the root user to their default state, allowing you to access phpMyAdmin seamlessly from both "localhost/phpmyadmin/" and "127.0.0.1/phpmyadmin/" without encountering the aforementioned access denied error message.
The above is the detailed content of Why Does \'localhost/phpmyadmin/\' Fail While \'127.0.0.1/phpmyadmin/\' Works, and How Can I Fix the \'Access Denied\' Error?. For more information, please follow other related articles on the PHP Chinese website!