Fix MAMP, MySQL Workbench “Failed to Connect to MySQL”
Installing MAMP was easy. I did, however, spend at least 45 minutes trying to get MySQL Workbench to connect to my local MySQL database server. The solution was simple, but getting there led me around the Internet and back with little help. Hopefully this signpost will help others having connection issues with MySQL Workbench to MAMP MySQL servers as well.
Once MAMP is installed and the MySQL server has started, you’ll be taken to a start screen that looks something like this:
The information presented there is misleading. The start page instructs you to use port 3306. So I did:
When testing the connection, however, I got the dreaded “Failed to Connect to MySQL at localhost”:
It turns out that MAMP has a preferences panel wherein you can configure the ports for your Apache and MySQL servers. And of course, MySQL was not set to use port 3306, as the start page led me to believe. Rather, it was set to use port 8889:
Adjusting the settings to use the port listed in the MAMP preferences pane led to a successful connection!