Laravel Herd can run MySQL for your .test sites while php artisan migrate succeeds, then a desktop GUI fails with error 2002 or connection refused. That split almost always comes from how the client treats localhost, which port Herd actually bound, and a Unix socket path that is not /tmp/mysql.sock.
Copy values from the Herd Services panel
Herd Pro installs MySQL as a service you start from Settings, not as a Homebrew formula. Select the MySQL instance and read the host, port, username, and password printed on the right. Those fields are the source of truth. Official docs show DB_HOST=127.0.0.1 with user root and an empty password. The sample DB_PORT in the docs is 3307 because you may have moved the service off 3306. Default installs frequently stay on 3306. Never guess. If the panel says 3309, the GUI must use 3309.
Leave SSH off. Herd MySQL listens on loopback. An SSH tunnel points the client at a bastion you do not have for this stack.
TablePlus and AdminerEvo can open from the same panel with a filled connection string. Any other desktop client, including TabulaSQL, needs those values typed once.
Why localhost fails while artisan works
Laravel's default .env for Herd uses DB_HOST=127.0.0.1. Artisan therefore talks TCP to the loopback address. Many GUIs still default the host field to localhost.
On macOS and Linux, the MySQL client library treats localhost as "use a Unix socket." The path it tries is usually /tmp/mysql.sock. Herd does not create that file. Each Herd MySQL instance uses a UUID socket such as /tmp/mysql-FA48B5C6-2000-4C1C-A239-AFA770E7CFA5.sock. The CLI then prints:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
The GUI surfaces the same failure as a generic cannot-connect dialog. Switching the host to 127.0.0.1 forces TCP and uses the port from the Services panel.
Windows has no Unix socket, but localhost can still pick a named pipe or a different resolver path than 127.0.0.1. For Herd, stay on TCP: host 127.0.0.1, port from the panel.
If you want a socket connection on Mac, open the service folder from Herd (right-click the instance), copy the UUID directory name, and set the socket to /tmp/mysql-<UUID>.sock. Most desktop clients are simpler if you skip sockets entirely.
Port collisions with Homebrew, XAMPP, and Docker
A GUI that "works" on 3306 may be talking to leftover Homebrew MySQL, XAMPP, or a Compose publish, not Herd. Confirm with SELECT VERSION(); and by creating a throwaway database in the GUI, then checking that php artisan tinker sees it.
Herd lets you run more than one MySQL version. Each instance has its own port. Name GUI connections after the instance (Herd MySQL 8.0, Herd MySQL 8.4) so you never grant on the wrong server.
Project Docker is a separate TCP listener. If Sail or Compose still publishes 3306 or 3307, keep a second saved connection. The Docker mapping walkthrough is at /articles/connect-mysql-gui-to-docker. This page covers only Herd's native service.
Sail leftovers in .env (DB_HOST=mysql) are a container hostname. A desktop GUI on your Mac or PC cannot resolve mysql unless you added it to hosts.
GUI fields that match Herd
| Field | Typical Herd value | Notes |
|---|---|---|
| Host | 127.0.0.1 |
Not localhost, not mysql |
| Port | panel value (often 3306) |
Match Herd, not a Compose file |
| User | root |
Unless you created an app user |
| Password | empty | Type nothing. Do not paste a space. |
| Database | empty or your app name | Empty lists every schema you can see |
| SSH | off | Local loopback only |
| SSL | off unless you enabled it in my.cnf |
Local Herd does not require TLS |
Prove the CLI first:
mysql -u root -h 127.0.0.1 -P 3306 -p
Replace 3306 with the panel port. Press Enter at the password prompt if root has no password. If this fails, fix Herd (service stopped, wrong port) before changing GUI settings.
Step-by-step in TabulaSQL
- In Herd, start the MySQL service and copy host, port, user, and password from the Services panel.
- Open TabulaSQL. Click the + button above the connections list.
- Choose the MySQL/MariaDB driver. Name the connection
Herd MySQLand pick a colour that is not your staging colour. - Set host
127.0.0.1, the copied port, usernameroot, and leave the password blank unless the panel shows one. - Leave the database field empty if you want every schema. Turn SSH off.
- Click Test connection. Save only after it succeeds.
- Open a table or run
SELECT VERSION();in the SQL editor.
Passwords stay encrypted on disk. There is no account and no telemetry. If Gatekeeper blocks the Mac build, right-click the app and choose Open, same as other unsigned local tools.
TabulaSQL is a free option at https://tabulasql.com/download. TablePlus, DBeaver, and HeidiSQL accept the same host and port. The 127.0.0.1 rule does not depend on the client brand.
Errors that still look like auth
Connection refused (2003) means nothing accepted TCP on that port: the Herd service is stopped, autostart is off, or you typed 3306 while the panel shows 3307.
Access denied (1045) with a blank password often means you reached a different MySQL that does require a password (Homebrew, Docker). Or you pasted a space into the password field. TCP to 127.0.0.1 is the usual fix when the user exists as root@localhost.
Auth plugin errors on MySQL 8 belong to a different fix: /articles/fix-mysql-caching-sha2-gui. Herd's root user is normally fine with a current desktop client.
Empty schema lists usually mean you restricted the connection to a database name that does not exist yet. Create it in the GUI or with CREATE DATABASE laravel;, then match DB_DATABASE in .env.
When the GUI is up, colour the Herd connection so it never looks like production.