Enable MySQL General Logging Using MAMP

Norah O'Donnell non sequitur

Norah O’Donnell non sequitur

Any Mac web developers out there right now still fiddling around with the version of PHP that Apple ships on every Mac needs to stop right now.

I’ve been there. When OSX first came out I tried to make Apple’s PHP and Apache to work. I did get it to work, but it was a total pain in the ass to keep working. I quickly realized that MAMP was the way to go. It adheres to the Apple slogan, “It just works.”

By default MAMP’s MySQL server is not configured to log all queries. I only MAMP for web development, so I’ll take the performance hit and enable general logging.

It’s pretty easy to do.

Open up /Applications/MAMP/conf/my.cnf and add the following section.

general_log = 1
general_log_file = /Applications/MAMP/logs/mysql.log

Save that file and restart MAMP services.

Share Button