Ever wanted to track down slow SQL queries while developing with MAMP on OS X? From the MAMP control panel edit the my.cnf
template:
Track down the section starting with [mysqld]
and add the following highlighted lines:
# The MySQL server [mysqld] log_slow_queries=/Applications/MAMP/logs/mysql_slow.log long_query_time=1
Restart MAMP and any slow queries (queries over 1 second, configurable via the long_query_time
option above) will be logged to /Applications/MAMP/logs/mysql_slow.log
.
Now I have no excuse to forget this.