Plesk fails to load: "Can't connect to local MySQL server through socket"

Refers to:

  • Plesk for Linux

Created:

2016-11-16 13:10:20 UTC

Modified:

2017-02-12 11:58:39 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Plesk fails to load: "Can't connect to local MySQL server through socket"

Symptoms

  1. Plesk fails to load with the following error:

        Unable to connect to database: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

    or

    ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory (Abstract.php:144)
  2. MySQL fails to start with the error below:

        Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

Cause

The server does not have enough free disk space.

Resolution

  1. Check disk usage:

    # df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/pl-var
    129G 129G 0 100% /var
    /dev/mapper/pl-root
    96G 12G 79G 100% /
    /dev/sda1 190M 19M 162M 100% /boot
    tmpfs 3.9G 0 3.9G 0% /dev/shm
  2. Free up some space or increase the disk size. Also du -sh directory_path can be used to find the disk usage of directories.

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