Mysqli_real_connect(): (hy000/1045): access denied for user 'root'@'localhost' (using password: no) - what should I do now?

1.9K    Asked by EmilyColeman in SQL Server , Asked on Oct 3, 2022

have newly installed MySQL 8 and PhpMyAdmin. I did all the installation steps properly. but once I get login to PhpMyAdmin by root user, it always gives an set of errors at the bottom of page saying -

The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why.

Or alternatively go to the 'Operations' tab of any database to set it up there.

mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES)

Connection for controluser as defined in your configuration failed.


Answered by Emma Cornish

In case of - mysqli_real_connect(): (hy000/1045): access denied for user 'root'@'localhost' (using password: no)


You appear to have instructed phpMyAdmin to use the "Configuration Storage" database (which gives you extra features such as bookmarking queries), but the associated user doesn't seem to exist or have proper permissions.

You can remove the configuration directive that is telling phpMyAdmin to use the advanced features by editing config.inc.php and setting $cfg['Servers'][$i]['pmadb'] to a blank string, like $cfg['Servers'][$i]['pmadb'] = '';

There is a chance the user, called the controluser, is misconfigured. If the user appears to exist in your phpMyAdmin, then probably either the host field or password are incorrect.

Assuming it doesn't exist, you could create the missing user, using the username and password you define in config.inc.php for the controluser and control pass fields:

With MariaDB:

CREATE USER 'pma'@'localhost' IDENTIFIED VIA mysql_native_password USING 'pmapass';

GRANT SELECT, INSERT, UPDATE, DELETE ON ``.* TO 'pma'@'localhost';

For MySQL 8.0 and newer:

CREATE USER 'pma'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'pmapass';
GRANT SELECT, INSERT, UPDATE, DELETE ON .* TO 'pma'@'localhost';
For MySQL older than 8.0:
CREATE USER 'pma'@'localhost' IDENTIFIED WITH mysql_native_password AS 'pmapass';
GRANT SELECT, INSERT, UPDATE, DELETE ON .* TO 'pma'@'localhost';


Your Answer

Interviews

Parent Categories