Question

I need to install the DMG MySQL start up package and then restart my computer, every time, in order for my mysql.sock file to appear in my /tmp/ folder. Otherwise, I am not able to locate that file, and for all intents and purposes, it isn't available.

Note: I am running Lion 10.7.5, and I am using MySQL5.6.10 (64bit), if that makes any difference.

How can I solve this problem so that the mysql.sock file will permanently stay in that folder?

Thanks.

Was it helpful?

Solution

mysql.sock is a socket file and will only appear while your MySQL server process (mysqld) is running. Start your MySQL server process and it will appear where ever the configuration for mysql indicates. The location of the socket file is defined in your mysql configuration file, typically this is found at /etc/my.cnf on linux machines, but on OSX it depends on where your mysql is installed.

When you find the my.cnf file you can look for a line like this to confirm that it's indeed meant to be created in /tmp:

  socket=/tmp/mysql.sock

Note: A socket isn't a file in the traditional sense. It's basically a named pipe used for communication between processes on unix-based systems. It will appear to be 0 bytes and only be present when the program creating the socket is running.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top