Ubuntu – How to solve “Access denied for user ‘phptheadmin’@’localhost’ (using password: YES)”

Apache2MySQLphpmyadminsql

La connexion au controluser tel que défini dans votre configuration a échoué.

mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES)
The connection to the controluser as defined in your configuration has failed..

Best Answer

I know this post is old, but here is what happened to me. I was upgrading and the phpmyadmin installer asked what the phpmyadmin user password should be, or to leave it blank to random generate a password. I hit enter without entering any password by mistake. So when I launched PHPMyAdmin, I got the error "mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES)".

To fix it, I found the "config-db.php" file in /etc/phpmyadmin/ and got the password from there. Root access to PHPMyAdmin was working, so I logged in as root to PHPMyAdmin and used the query "SET PASSWORD FOR 'phpmyadmin'@'localhost' = PASSWORD([copy and paste the password here])" and it worked!

Related Question