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

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

Step 2. Set the password again for that cpanel user

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.