My error was “can’t connect to local mysql server through socket ‘/tmp/mysql.sock’ (2) homebrew” and I was just going crazy trying to fix it, maybe just like you. I got this error when I installed MySQL through homebrew, when I did the MySQL command “mysql” in my terminal.
What fixed this problem for me was deleting MySQL and I used this command since I knew it was there,
BUT make sure you don’t have anything valuable there of course
rm -rf /usr/local/var/mysql/
Then I went ahead and removed MySQL from HomBrew
brew remove mysql
Then, of course, I went ahead and installed it again.
brew install mysql
3 comments On can’t connect to local mysql server through socket ‘/tmp/mysql.sock’ (2) Homebrew – How I fixed it.
I have completed your HTML CSS course in Udemy and now finding difficult to get a proof of work. People nowadays require certificates and other materials to show that we have knowledge in that.
So I kindly wish you to provide a certificate.
I know, and I’m sorry about that, but Udemy is not providing certificates for free courses anymore.
Anyone coming across these command, STOP!!!!!
SQL stores your databases in /usr/local/var/mysql/ so, if like me, you come across an issue with starting your sql server, this will delete all your work.
A very dangerous command, because they are permanently deleted.