You’ve installed MySQL on your Mac — now it needs to actually be running before anything can connect to it. A MySQL server that isn’t started is the number-one cause of the dreaded Can't connect to local MySQL server through socket error, and starting it takes about ten seconds once you know where to look. There are four ways, depending on how you installed it and how you like to work.
Option 1: The System Settings pane (official installer)
If you used the DMG installer from mysql.com, you got a settings pane for free:
- Open System Settings (System Preferences on older macOS).
- Scroll to the MySQL icon — bottom of the sidebar.
- Click Start MySQL Server.
The pane shows a green “running” indicator, and the checkbox to start MySQL when your computer starts up is worth ticking on a machine you use for daily analytics work — under the hood it registers the server with launchd, macOS’s service manager, so you never think about it again.
Option 2: brew services (Homebrew installs)
If MySQL came from Homebrew, the settings pane doesn’t exist — brew services is the equivalent:
brew services start mysqlThat both starts the server and registers it to relaunch on login. For a one-off start that doesn’t survive a reboot, use brew services run mysql. Stop it with brew services stop mysql, and see what’s registered with brew services list.
Option 3: mysql.server from the terminal
Both install types ship a control script that works without any service manager:
mysql.server start
mysql.server status
mysql.server stop(If the command isn’t found, it lives at /usr/local/mysql/support-files/mysql.server on DMG installs.) This is the right tool when you only want the database up while you’re using it.
Option 4: launchctl, for the curious
The settings pane and brew are both just wrappers around launchd. The raw incantation for a DMG install looks like:
sudo launchctl load -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plistYou’ll rarely need this directly, but knowing it demystifies what “start at login” actually does — and it’s the lever to pull when the GUI checkbox stops behaving.
Verify it’s actually running
Trust, but verify — any of these confirms the server is up:
mysqladmin -u root -p statusor check for the process directly with pgrep -fl mysqld. Then connect: mysql -u root -p from the terminal, or fire up MySQL Workbench if you’re coming from the SQL Server Management Studio world and want a familiar GUI. Our next tutorial covers creating a schema in MySQL Workbench on macOS.
When it won’t start
- Port already in use — something else (often a second MySQL install, or a Docker container) is holding port 3306.
lsof -i :3306names the culprit. - Permissions on the data directory — usually after a botched upgrade; the error log at
/usr/local/mysql/data/*.err(or$(brew --prefix)/var/mysql/*.err) says exactly which files it can’t touch. - Forgotten root password — not a startup problem, but it blocks you right after startup; we cover resetting the MySQL root password on macOS separately.
Once the server starts reliably, the interesting work begins — modeling the data, not babysitting the engine. That’s the part we do professionally: MySQL consulting.