how to enable MySQL query log?

1、to enable the query log,put this in /etc/my.cnf in the [mysqld] section

log=/usr/local/mysql_query.log

2、this worked for me(Mysql 5.6.12 on windows),set parameter int the mysql console:

set global general_log=on;

set global general=1#(or 0 to disable)

set global  general_log_file='c:/mysql_query.log'

set global log_output='file'



linux下修改my.cnf如下:

[[mysqld]]
general-log
general-log-file=queries.log
log-output=file


你可能感兴趣的:(mysql)