Unable to connect to database: mysql_connect() function.mysql-connect: Permission denied

Refers to:

  • Plesk 10.4 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux

Created:

2016-11-16 12:57:16 UTC

Modified:

2016-12-21 19:37:23 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to connect to database: mysql_connect() function.mysql-connect: Permission denied

Symptoms

Unable to access Plesk, page shows error:

Error message or request description : ERROR: PleskFatalException
Unable to connect to database: mysql_connect() function.mysql-connect: Permission denied

MySQL service failed trying to restart.

In /var/log/mysqld.log these errors can be found:

[ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
[ERROR] Can't start server: can't create PID file: Permission denied

Cause

Wrong permissions on MySQL directory.

Resolution

  1. Make sure that owner and group of /var/run/mysqld/ directory is mysql:mysql and permissions are as below:

    # ls -ld /var/run/mysqld/  
    drwxr-xr-x 2 mysql mysql 4096 Jul 14 18:16 /var/run/mysqld/
  2. Correct permissions and start Mysql service.

Have more questions? Submit a request
Please sign in to leave a comment.