Home >Backend Development >PHP Tutorial >How to Fix \'Access Denied\' Error When Connecting to MySQL via phpMyAdmin?
Troubleshooting Access Denied Error in phpMyAdmin
Problem:
When attempting to access phpMyAdmin through localhost/phpmyadmin/, users may encounter an "Access denied" error for the root user with localhost as the host. The error indicates that the connection to the MySQL server was rejected due to an incorrect host, username, or password.
Solution:
To resolve this issue without reinstalling WAMP, follow these steps:
Search for the following line:
<code class="php">$cfg['Servers'][$i]['password'] =";</code>
Replace the empty string with your desired root password:
<code class="php">$cfg['Servers'][$i]['password'] = 'Type your root password here';</code>
Restart phpMyAdmin and try accessing it through localhost/phpmyadmin/. The "Access denied" error should now be resolved.
The above is the detailed content of How to Fix \'Access Denied\' Error When Connecting to MySQL via phpMyAdmin?. For more information, please follow other related articles on the PHP Chinese website!