Home >Database >Mysql Tutorial >How Do I Fix the \'Access denied for user \'root\'@\'localhost\'\' Error in phpMyAdmin?

How Do I Fix the \'Access denied for user \'root\'@\'localhost\'\' Error in phpMyAdmin?

DDD
DDDOriginal
2024-11-26 00:46:11833browse

How Do I Fix the

Fixing Access Denied Error for 'Root' User in phpMyAdmin

In phpMyAdmin, when attempting to access databases using the 'root' user with 'localhost' host, an error may arise stating "Access denied for user 'root'@'localhost'...". This guide outlines a solution to this issue.

Within the WAMP Server installation, navigate to "C:wampappsphpmyadmin3.5.1". Open the "config.inc.php" file. Locate the line "$cfg['Servers'][$i]['password'] =";". Change this line to include the root password within single quotes:

$cfg['Servers'][$i]['password'] = 'Your_Root_Password';

Save the modified "config.inc.php" file and restart both Apache and MySQL services within WAMP Server.

Upon revisiting "localhost/phpmyadmin/", access to the databases should be restored, and the error message should no longer appear.

The above is the detailed content of How Do I Fix the \'Access denied for user \'root\'@\'localhost\'\' Error in phpMyAdmin?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn