Have a pretty simple problem, I have accidentally deleted /tmp/mysql.sock file

Now I can not use mysqladmin or anything

How can I recreate this file?

Before I asking this question I have looked at related questions, but I could not find info that I needed.

Thank You

link|improve this question

feedback

5 Answers

up vote 0 down vote accepted

Are you sure your mysql.sock is inside /tmp/? I think usually this is located in /home/mysql or under the data directory (/var/lib/mysql/). You may as well check if it is still available there.

If it is, rather than restarting the daemon, you can just create a softlink to /tmp:

ln -s /var/lib/mysql/mysql.sock /tmp/
link|improve this answer
feedback

Restart mysqld.

/etc/init.d/mysql restart

or

/sbin/service mysql restart
link|improve this answer
Unfortunately I have installed MySQL from source :( – Daniil Harik Oct 12 '09 at 16:01
How do you start it? You can have an init script even if you install from source. If you don't have one, just killall mysqld and restart it however you normally do. – Josh Oct 12 '09 at 16:02
feedback

Just restart your MySQL daemon.

link|improve this answer
feedback

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

link|improve this answer
feedback

edited my.cnf to reflect this (replacing "socket = /var/lib/mysql/mysql.sock" with "socket = /opt/lampp/var/mysql/mysql.sock")

link|improve this answer
He didn't move it, he deleted the socket. he just needs MySQL to recreate it. – Josh Oct 12 '09 at 19:12
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.