Home > Enterprise >  MySQL installed via HomeBrew Error: Can't connect to local MySQL server through socket '/t
MySQL installed via HomeBrew Error: Can't connect to local MySQL server through socket '/t

Time:11-27

I've been searching for hours about this issue i'm having.

I have installed [email protected] in my mac osx Monterey 12.0.1 with M1 chip using Homebrew.

I've been following this tutorial that helped me install mysql version 5.7. I'm specifying this version because i'm recreating a production environment on local.

At the step where I need to secure my mysql installation I type user root password and get this error Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).

I have read many ways to fixing this but I can't make it work with any of those because most of them don't relate to homebrew or don't work well for me.

I have the service running using the brew services start [email protected] command and this doesn't seem fixing the issue.

Is there any possibility I can't make it run because I have an M1 chip?

CodePudding user response:

Do you have the mysql.sock in your /tmp?

You can make a symlink, depending on your installation

ln -s /var/mysql/mysql.sock /tmp/mysql.sock

CodePudding user response:

I researched again and remembered that I had previously installed a MySQL 8.X version. I uninstalled it only using the brew uninstall command. This wasn't enough and I made sure I deleted all the mysql related files and folders from my computer.

After that I retried installing MySQL 5.7 as a completely fresh install. Then at this same step where I had trouble before I didn't have any issue, I followed the installation and now is up and running.

  • Related