AndyJarrett

Where are the MySQL logs on Mac (or any other system)

This is for my reference as i've been setting this up locally on OSX but should work for Windows and Linux and it might help someone else.

To find your log location run the following

SHOW VARIABLES LIKE '%general_log%';  
SHOW VARIABLES LIKE '%slow_query_log%';  

You'll get something back like this

general_log            ON  
general_log_file       /usr/local/mysql/data/localhost.log  
slow_query_log         ON  
slow_query_log_file    /usr/local/mysql/data/localhost-slow.log  

With this info and the terminal (for *nix based machines) you can output the logs with tail and

$ tail -f -n1000 /usr/local/mysql/data/localhost.log

If any of the logs are off you can turn them on again via

SET GLOBAL general_log = 'ON';  
SET GLOBAL slow_query_log = 'ON';