[WP Local & PHPStorm] - Connecting to MySQL using TCP/IP rather than a socket on macOS/Linux?
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.