I run MAMP 4 on my Macbook to start the development of all my web projects. In short, I cannot do my job without it. So if it stops working it can be frustrating, to say the least. Occasionally the MAMP SQL server just won't start. And without it MAMP is...well useless. But I found a fix that works for me!
Discaimer: I'm just a marketing guy. Not a software developer. You follow my advice at your own risk. All I can say is that in my case, it works.
MAMP stands for Macintosh, Apache, MySQL, and PHP. It installs a local server environment on your laptop or desktop in matter of minutes. It is absolutely essential to quickly spin up a Joomla, Wordpress or Drupal site or anything else that requires a server environment to run.
So sometimes, when starting MAMP server, the MySQL service fails to start. This means that any application that relies on a database connection will not work. After searching the web for a solution none of the popular posts could help me fix the problem. I then stumbled on a short post on stackoverflow.com that pointed me in the right direction.
The Fix
To fix the issue (in my instance) was quite simple. Here are the steps to follow:
- Locate and open the my.cnf file. It should be located here: MAMP/conf/my.cnf
- Locate the line that says:
innodb_force_recovery = 0
and change it to innodb_force_recovery = 1
- Save and close the file
- Quit and restart MAMP and Restart all services
That's it. The MySQL service should start without a problem and the work can go on. I hope this has helped you in some way. Good luck.