Error when try to use PHPMyAdmin in the Plesk CP

Sometimes you might get the following error when try to use PHPMyAdmin in Plesk CP:

“#1045 - Access denied for user ‘pma_xxxxxxx’@'localhost’ (using password: YES)”

You can use the following to fix the issue:

Make sure Plesk PHPMyAdmin user exists in mysql.user table and has right password and privileges. User name and password can be found in /usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/config.inc.php file.

# cd /usr/local/psa/admin
# grep controluser htdocs/domains/databases/phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['controluser'] = ‘USER’;

# grep controlpass htdocs/domains/databases/phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['controlpass'] = ‘PASSWORD’;

# grep pmadb htdocs/domains/databases/phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['pmadb'] = ‘DATABASE’;

Try to login as this user into MySQL from the command line. If the password doesn’t match, update mysql.user table and set ‘PASSWORD’ password for ‘USER’. If such user doesn’t exist in Mysql, create it with commands like:

# mysql -uadmin -p`cat /etc/psa/.psa.shadow`

mysql> use mysql;
mysql> insert into user values (’localhost’,'USER’,password(’PASSWORD’),’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',’N',”,”,”,”,0,0,0);
mysql> INSERT INTO `db` VALUES(’localhost’,'DATABASE’,'USER’,'Y’,'Y’,'Y’,'Y’,'N’,'N’,'N’,'N’,'N’,'N’,'N’,'N’);
mysql> flush privileges;

Replace USER, PASSWORD and DATABASE with the right values from config.inc.php.

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.