Configure MySql to listen on all ports with Homebrew
Update!
I recently helped a coworker get this working on his machine. In more recent versions of mysql on homebrew you can use the following script.
mysql_secure_installation
This was easier than dealing with the MacOs configuration files, as well as the homebrew files. However, if you're still interested, read on..
Configuring Startup Params Manually
I use a piece of software at work that only seems to work on Windows. It interacts with a database that I also connect to on my Mac. By default Homebrew appears to launch mysql with it listening only on localhost.
Long story short you need to update homebrew.mxcl.mysql.plist file in ~/Library/LaunchAgents with a bind-address param that allows connections from any ip.
This message appears after you install mysql. It recommend symlinking the file to LaunchAgents.
To have launchd start mysql at login: ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents Then to load mysql now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist Or, if you don't want/need launchctl, you can just run: mysql.server start
I modified /usr/local/opt/mysql/homebrew.mxcl.mysql.plist and added the following.
--bind-address=*
Then went ahead and restarted mysql using the following command.
sudo brew services restart mysql
Tailing the error log was helpful..
tail -f /usr/local/var/mysql/JM-PEs-MacBook-Pro.local.err
Double checking what ports and addresses mysql was listening on was also helpful.
sudo lsof -i -n -P | grep 3306
And remember listening on 127.0.0.1 means only accept connections from localhost. Listening to 0.0.0.0 means accept connections on any interface.