MAMP is a good way to setup a low-maintenance dev environment for OS X in very little time, but its handling of MySQL is quite annoying.
When you suspend/sleep a computer, often when you resume MAMP has lost track of the MySQL instance it started and can no longer connect to it. Not sure if this is a problem with the MySQL build being used, but as the problem has existed since 2009, I don’t have high hopes for it being fixed anytime soon.
The quickest solution is to kill off the process it had started previously and then hit “Start Servers” again — it just takes one line on the terminal.
killall -9 mysqld
Be aware that this will kill all running MySQL processes (including those outside of MAMP’s control) — this is normally fine, as no-one actually hosts websites on OS X!