For years I’ve been connecting Navicat to LocalWP for WordPress development. Connecting with sockets stopped working when I upgraded to a Mac Studio with M2 Ultra chip. I found this post which got me back in business. Putting it here for my own peace of mind.
Steps
- Right-click on the site you wish to connect to via TCP/IP in Local’s sidebar and go to “Open Site Shell.”
- Once your terminal opens, run the following commands:
Allow `root` to connect via `127.0.0.1`
mysql -e "CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'root'; GRANT ALL ON *.* TO 'root'@'127.0.0.1';"
Get the TCP/IP port that MySQL is currently running on.
mysql -e "SHOW VARIABLES WHERE Variable_name = 'port';"


DataGrip used to always give me trouble with sockets. So many extra steps. Piece of cake now.
