How to Enable MySQL Query Logging at Runtime From the mysql client run: mysql> SET GLOBAL general_log=true; mysql> SET GLOBAL general_log_file='general.log'; After this queries will be logged to the named file located in the MySQL data directory. e.g. /var/lib/mysql/general.log.