PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, March 17, 2022

[FIXED] MySQL w/ MAMP - Symbolic link disappears after I quit MAMP

 March 17, 2022     macos, mamp, mysql     No comments   

Issue

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.


Solution

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.



Answered By - Victor Valente
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing