How to re-create /tmp/mysql.sock?

Solution 1:

Restart mysqld.

/etc/init.d/mysql restart

or

/sbin/service mysql restart

Solution 2:

Just restart your MySQL daemon.

Solution 3:

You can't recreate it since it's a named socket. As others have said, you must restart mysqld.