I run mysql on OSX, now when I restart my computer it does not create the mysql.sock, meaning that all my connections gives me a error 2002.
anyone knows how to prevent this?
mysqld. sock is created by the mysql daemon on start, and it is removed (or, becomes un-connectable) if this daemon stops. This message is given by some client process, trying to connect your mysqld on this socket without success. Its most likely reason is that the mysqld doesn't run.
sock , but on my Mac (Mac OS X 10.5) the socket is really located at /private/tmp/mysql. sock .
The MySQL server's socket file is named mysqld. sock and on Ubuntu systems it's usually stored in the /var/run/mysqld/ directory. This file is created by the MySQL service automatically.
I had this same issue on Snow Leopard, the socket spawns in the wrong location for some reason on OS X.
To get the socket spawning in the correct location: create a new file "my.cnf" in /etc with the following lines:
[mysqld]
socket=/var/mysql/mysql.sock
[client]
socket=/var/mysql/mysql.sock
and restart mysqld: sudo /usr/local/mysql/bin/mysqld_safe
This will force the MySQL socket file to spawn in the proper location, and everything should work normally. Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With