As many others WordPress developers out there, I use MAMP for local development.
I like the fact that is the faster and easier way to setup a low-maintenance development environment for OSX. Personally, I love setting up and using virtual hosts & WordPress multisite. That way I can work with loads of different projects in an organized manner.
The only problem I often get with this platform, is that MySQL won’t start. I hate when I resume my computer after sleeping a few hours, and I get that annoying red light just beside “MySQL server” indicator. Sometimes, it also happens when restarting your computer. And there it is, MySQL not starting.
There’s an easy solution for this, a quick and tiny fix you can run as many times you need. Simply killing all MySQL processes and then starting the servers again. Assuming that not many people hosts websites on OSX, you won’t have any collateral damage.
killall -9 mysqld
This command will kill off the process. Then you’ll be able to start again your servers by hitting “Start Servers” in the MAMP app.
Note: Terminal is the terminal emulator included in Apple’s OS X operating system. You can find that app under Applications/Utilities. It’s basically a UNIX Shell. You can check if there are any MySQL processes running the “top” command. You can also use Hyper, a terminal app built by the amazing @rauchg and team.
Update – January 2017
If you are having trouble fixing this issue with the instructions above, many readers are being able to solve this problem thanks to the amazing fix shared by one of the commenters, ElCid. The instructions he shared are the following:
- Quit MAMP.
- In the finder go to Applications/MAMP/db/mysql/ and delete the last log file (look for a file named ib_logfileN – being N the log number). Please back up these before you delete them
- Restart MAMP.
- That’s it!