Plesk is not accessible: Unable to connect to database: mysql_connect(): No such file or directory

Created:

2016-11-16 12:40:20 UTC

Modified:

2017-08-16 16:54:40 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Plesk is not accessible: Unable to connect to database: mysql_connect(): No such file or directory

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk Onyx for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux
  • Plesk 10.x for Windows

Symptoms

Plesk is not accessible. The following error appears:

ERROR: PleskFatalException: Unable to connect to database: mysql_connect(): No such file or directory (auth.php:142)

or

Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory (Abstract.php:144)

MySQL service status is:

# service mysqld status
mysqld is stopped

or

# service mysqld status
ERROR! MySQL is running but PID file could not be found

or

# service mysqld status
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists

The following error is found in /var/log/mysqld.log file:

[ERROR] /usr/libexec/mysqld: Error writing file '/var/run/mysqld/mysqld.pid' (Errcode: 28)
[ERROR] Can't start server: can't create PID file: No space left on device

Cause

No space left on the hard disk:

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_vtivercrm-lv_root
50G 49G 0 100% /
tmpfs 16G 532K 16G 1% /dev/shm
/dev/sda1 485M 38M 423M 9% /boot
/dev/mapper/vg_vtivercrm-lv_home
341G 294M 323G 1% /home

Resolution

Connect to the server using SSH.

Free up disk space.

To find the largest 10 files, run the following command:

# find /var -type f -print0 | xargs -0 du | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}

To find the largest 10 directories, run the following command:

# find /var -type d -print0 | xargs -0 du | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}

Additional information:

If this does not help to start MySQL service, try to find a solution in the Plesk Knowledge Base using error from /var/log/mysqld.log .

The following article may be helpful:

213939865 How to fix InnoDB corruption cases for the MySQL database

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