MAMP Pro: Enable MySQL General Logging

MAMP Pro: Enable MySQL General Logging

If you are looking to see exactly what your MySQL server is doing (this includes logging of all query’s on your databases) you enable the MySQL general query log. By default, this is disabled in the MAMP my.cnf configuration file. In fact, the general query log directive does not exist in the configuration file of MAMP it seems. Follow the steps below.

 

  1. Open MAMP and go to Edit Template -> MySQL -> your version.cnf.
 
  1. Find [mysqld] in your configuration file. This is typically found around line 26. We must enable the general query log under this [mysqld] setting.
 
  1. Add the following 2 lines to enable general logging. You can just add these under the socket directive pictured below.
 
general_log = 1
general_log_file = "/Applications/MAMP/logs/mysql_access.log"

 

Mamp pro enable mysql general query log

 

  1. Save the file.
 
  1. Restart MAMP Apache and MySQL Servers.
 

Note: MySQL general logging will quickly fill up your log file, especially if you have multiple databases being queried often. It is not advised to leave this enabled for an extended period of time and should only be used to troubleshoot things temporarily.

 

Browse some of your sites to invoke queries. Check your mysql_access.log file to see the details of the query’s and more.
 






* Please use the comment form below. Comments are moderated.*



Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Thursday, 25 April 2024