I’ve been forced to use MySQL for a project I’m on, and amongst the many annoyances I’ve found so far was this one today:
110421 12:58:27 [ERROR] Can’t start server : Bind on unix socket: Address already in use
110421 12:58:27 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
110421 12:58:27 [ERROR] Aborting
The reference page for errorshttp://dev.mysql.com/doc/refman/5.1/en/starti… says to check that something else isn’t running using
telnet, and then to check your firewall.
Well, firstly, I’d say that using
sudo lsof -i :3306 is a much better way (on OSX, at least) to find out what is running on that port, but there was nothing running on my port.
So I went for the Occam’s razorhttp://en.wikipedia.org/wiki/Occam’s_razor solution - MySQL is pretty crap. It worked, there was a file /tmp/mysql.sock that hadn’t been cleared away by the last instance, and the new instance is too stupid to work out if that file should be there.
rm /tmp/mysql.sock isn’t listed in the reference. I’m not surprised.