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

I copied the filesystem from one host to another, hoping that things would 'just work'. But that was a bit too optimistic, there was no way I could MySQL going again. This is what was reported in the error logs:

080723 10:21:43 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql
080723 10:21:43 InnoDB: Started; log sequence number 0 331568728
080723 10:21:43 [ERROR] Can't start server : Bind on unix socket: Permission denied
080723 10:21:43 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
080723 10:21:43 [ERROR] Aborting
080723 10:21:43 InnoDB: Starting shutdown...
080723 10:21:46 InnoDB: Shutdown completed; log sequence number 0 331568728
080723 10:21:46 [Note] /usr/local/libexec/mysqld: Shutdown complete

So it is some permission problem. The data directory (/usr/local/mysql) had the right permissions. But it turned out that /tmp did not have proper permissions. They were 755 instead of 777. Somehow the dump & restore did not set the permissions properly, because 777 was set on the original host. MySQL starts fine after this permission adjustment.

I had same problem with

I had same problem with mysql-5.1 and FreeBSD-7.1. Problem was solved after chmod 1777 /tmp. This directory had default perms 777 and /tmp/mysql.sock could'nt be created.

Copying with permissions

Thanks for your post. I was doing something similar to you - copying my var/ folder into home/var and adding a softlink. Forgot to use the "-p" flag when copying. This is often neglected in Unix, and you find yourself copying complete folder structures with losing all attribute information - users, groups, etc.
Thank again.

I had same problem

#chmod 777 /var/www/mysqld
#mysqld

Back up and running.. Note to self - do NOT chmod -R /var Tongue doh!
Debian 5.04 - MySQL 5.0.51a