Articles in this section

Unable to add external database server in Plesk: 1044 Access denied for user

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

Unable to add an external MySQL database server in Plesk:

PLESK_ERROR: Error: SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'pleskadmin'@'192.0.2.2' to database 'example_db'

Cause

Not enough permissions for root user on remote database server.

MYSQL_LIN: select User,Grant_priv from user where User='root' and Host='192.0.2.2'\G;
*************************** 1. row ***************************
User: root
Grant_priv: N

Resolution

  1. Connect to MySQL as root/super user on the remote database server

  2. Grant permissions to the user used in Plesk:

    For MySQL:

    MYSQL_LIN: update user set Grant_priv = 'Y' where Host = '192.0.2.2' and User = 'pleskadmin';

    For MariaDB:

    MYSQL_LIN: GRANT ALL PRIVILEGES ON *.* TO `pleskadmin`@`192.0.2.2` WITH GRANT OPTION;

  3. Flush the privileges:

    MYSQL_LIN: flush privileges;

  4. Add external database server to Plesk
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.