PHPMyAdmin Access denied for user X @ localhost

PHPMyAdmin Access denied for user X @ localhost

When you can’t log in to PHPMyAdmin from within cPanel it’s mainly one of two reasons:

  1. When you reset the password for that user, MySQL password wasn’t changed
  2. user has a custom .my.cnf file with defined logins for mysql
image 104 - PHPMyAdmin Access denied for user X @ localhost

Step 1. Delete the user definded .my.cnf file

2022 05 21 15 33 1024x507 - PHPMyAdmin Access denied for user X @ localhost

Step 2. Set the password again for that cpanel user

image 103 1024x506 - PHPMyAdmin Access denied for user X @ localhost

That’s it, now just log again to cPanel and go to PHPMyAdmin.


If you still can’t log in PHPMyAdmin, try setting the MySQL password for that user manually:

mysql
set password for 'USERNAMEHERE'@'localhost' = PASSWORD(' [ PASSWORDHERE ] ');
flush privileges;
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.