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

Created:

2016-11-16 12:57:16 UTC

Modified:

2017-08-16 16:59:18 UTC

0

Was this article helpful?


Have more questions?

リクエストを送信

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

Applicable to:

  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 10.4 for Linux/Unix

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.
他にご質問がございましたら、リクエストを送信してください
ログインしてコメントを残してください。