Unable to access website hosted on CloudLinux 7: mysql_connect(): [2002] No such file or directory

Created:

2016-11-16 12:49:34 UTC

Modified:

2017-08-08 13:31:37 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to access website hosted on CloudLinux 7: mysql_connect(): [2002] No such file or directory

Applicable to:

  • Plesk 12.5 for Linux

Symptoms

Website showing the following error:

Internal server error 500

In domain's error_log file it is possible to find the following error:

PHP Warning:  mysql_connect(): [2002] No such file or directory (trying to connect via unix:///var/lib/mysql/mysql.sock)

CloudLinux 7 is installed and CageFS is also configured.

This command gives empty output:

# grep "/var/lib/mysql" /etc/cagefs/cagefs.mp

Cause

CageFS misconfiguration.

Resolution

  1. Add missing "/var/lib/mysql" line into /etc/cagefs/cagefs.mp :

    # grep "/var/lib/mysql" /etc/cagefs/cagefs.mp
    /var/lib/mysql
  2. Run cagefsctl -M

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