Thursday, August 1, 2019

macos - MySQL w/ MAMP - Symbolic link disappears after I quit MAMP



How can I change my MAMP mysql.sock file path from



/Applications/MAMP/tmp/mysql/mysql.sock



to something else that doesn't get deleted whenever I quit MAMP or restart the computer? I'm running Mac OS X Yosemite.



Details: MAMP / MySQL socket file gets erased every time I quit MAMP.


This is understandable, given that the mysql.sock file is stored in a tmp folder.

Current path is /Applications/MAMP/tmp/mysql/mysql.sock



Every time I run MAMP I have to recreate a symlink using the following command:

sudo ln -s [source] [target]



Source = /var/mysql/mysql.sock OR /tmp/mysql.sock

Target = /Applications/MAMP/tmp/mysql/mysql.sock



This is a known problem and a few answers have been given to other questions like this, but none provide a way to change where the MAMP mysql.sock file is stored.



Answer



I found that this has nothing to do with MAMP.



This file -> mysql.sock is not a definitive file, so to speak.
It's created every time you start mysqld, and it's deleted when you stop mysqld or restart/shutdown your computer.



So, to solve this you have to start mysqld every time you're going to do some database operation.



Or you can configure it as a startup program/script. Once you do this, your problems will be solved.


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...