MySQL does not start: Bind on unix socket: Permission denied

Created:

2016-11-16 12:52:13 UTC

Modified:

2017-08-16 18:34:27 UTC

5

Was this article helpful?


Have more questions?

Submit a request

MySQL does not start: Bind on unix socket: Permission denied

Applicable to:

  • Plesk 10.x for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

Mysql fails to start with error:

    Can't start server : Bind on unix socket: Permission denied

Following error is generated in the MySQL log file:

    # tailf /var/log/mysqld.log
InnoDB: Error: unable to create temporary file; errno: 13
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Can't start server : Bind on unix socket: Permission denied
[ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
[ERROR] Aborting

Cause

Wrong permission for Mysql , /tmp directories.

Resolution

Check the permission for Mysql direcories, they should look as below:

    # ls -ld /var/run/mysqld/
drwxr-xr-x 2 mysql mysql 4096 Feb 24 09:30 /var/run/mysqld/

# ls -la /var/lib/mysql
total 69744
drwxr-xr-x 13 mysql mysql 4096 Feb 24 09:30 .
drwxr-xr-x 31 root root 4096 Jun 6 2014 ..
-rw-rw---- 1 mysql mysql 60817408 Feb 24 10:05 ibdata1
-rw-rw---- 1 mysql mysql 5242880 Feb 24 10:05 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Feb 24 10:05 ib_logfile1
drwx------ 2 mysql mysql 4096 Jul 24 2014 mysql
srwxrwxrwx 1 mysql mysql 0 Feb 24 09:30 mysql.sock
Have more questions? Submit a request
Please sign in to leave a comment.