ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

I have installed LAMP using brew command on my MacBook. Installed Piwigo, and transferred my albums, and all works great. But, whenever I restart my MacBook, I would have this error


ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) 


I have removed mysql and install it again with brew command and it all works again until the MacBook is restarted. I have search for solutions and found this 


https://medium.com/@kjavaman12/error-20 … fb8d876af0


But it did not work, and I have to reinstall again. My technical ability was just to follow instructions. Any help will be much appreciated.

MacBook Pro (M3, 2023)

Posted on Jan 14, 2024 6:15 PM

Reply
5 replies

Jan 18, 2024 8:55 PM in response to MrHoffman

Thanks MrHoffman for your help. I have looked at MAMPP and XAMPP. These are bottled applications. Since I have done so much work and understanding of creating LAMP and my Piwigo photo album, I have decided to continue this strategy. The Piwigo forum suggested using Mariadb. I was successful and now my database is working even after restart of my MacBook.

Jan 14, 2024 7:46 PM in response to MrHoffman

Sorry, I already reinstalled, and it is working again until the next restart. I will take your advise and use MAMP (which I was not aware of since I am pretty new to macOS).


Thanks. I'll report the outcome after I installed MAMP.


Do I have to get rid of my existing installing first? It seems the MAMP description says I can leave them there.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.