Home > Database > Mysql Tutorial > Why am I getting \'Access denied for user \'root\'@\'localhost\'\' when setting my root password in PHPMyAdmin?

Why am I getting \'Access denied for user \'root\'@\'localhost\'\' when setting my root password in PHPMyAdmin?

Patricia Arquette
Release: 2024-11-02 17:02:02
Original
288 people have browsed it

Why am I getting

Resolving Access Denied Issue for 'root' User in PHPMyAdmin

Users may encounter an access denied error when attempting to set a root password in PHPMyAdmin. The message typically reads, "Access denied for user 'root'@'localhost' (using password: NO)."

Root Cause:

PHPMyAdmin is unable to connect to the database using the provided root credentials.

Solution:

To rectify this issue, you need to edit the phpmyadmin config.inc.php file. Locate the following code block:

$cfg['Servers'][$i]['user'] = '**your-root-username**';
$cfg['Servers'][$i]['password'] = '**root-password**';
Copy after login

Ensure that the "Password" string appears before the password value as shown below:

$cfg['Servers'][$i]['user'] = '**your-root-username**';
$cfg['Servers'][$i]['password'] = 'Password: **root-password**';
Copy after login

Additionally, verify that the root username and password are correct. Save the file and try accessing PHPMyAdmin again. The error should now be resolved, granting you access to the panel.

The above is the detailed content of Why am I getting \'Access denied for user \'root\'@\'localhost\'\' when setting my root password in PHPMyAdmin?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
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