Unable to log in to Plesk on Ubuntu 14.0: mysql_connect(): No such file or directory

Created:

2016-12-18 06:42:25 UTC

Modified:

2017-08-08 13:10:39 UTC

5

Was this article helpful?


Have more questions?

Submit a request

Unable to log in to Plesk on Ubuntu 14.0: mysql_connect(): No such file or directory

Applicable to:

  • Plesk 12.5 for Linux

Symptoms

  • Unable to log in to Plesk with the error message:

    ERROR: PleskDBException: Unable to connect to database: mysql_connect(): No such file or directory /var/run/mysqld/mysqld.sock (Error code: 2002). Please check that database server is started and accessible. (Abstract.php:69)
  • MySQL service is stopped and cannot be started:

    # service mysql start
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
  • Doing mysql stop results in:

    # /usr/sbin/mysqld stop
    161215 17:21:29 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
    /usr/sbin/mysqld: Error on realpath() on '/var/lib/mysql-files' (Error 2)
    161215 17:21:29 [ERROR] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files
    161215 17:21:29 [ERROR] Aborting

Cause

The directory /var/lib/mysql-files is missing. This is mysql package bug discussed here .

Resolution

Create the required directory:

# sudo mkdir /var/lib/mysql-files
# sudo chown -R mysql:mysql /var/lib/mysql-files/
# sudo chmod 700 /var/lib/mysql-files/
Have more questions? Submit a request
Please sign in to leave a comment.