Home > Backend Development > PHP Tutorial > How to Fix \'Access Denied\' Error When Connecting to MySQL via phpMyAdmin?

How to Fix \'Access Denied\' Error When Connecting to MySQL via phpMyAdmin?

Patricia Arquette
Release: 2024-10-19 11:47:29
Original
250 people have browsed it

How to Fix

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:

  1. Locate the config.inc file, typically found under C:wampappsphpmyadmin3.5.1.
  2. Search for the following line:

    <code class="php">$cfg['Servers'][$i]['password'] =";</code>
    Copy after login
  3. Replace the empty string with your desired root password:

    <code class="php">$cfg['Servers'][$i]['password'] = 'Type your root password here';</code>
    Copy after login
  4. Save and close the config.inc file.

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!

source:php
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template