Add this in my.cnf and then restart MySQL server:
general_log = 1
log=/var/log/mysql_slowquery.log
You can check whether the general_log is 'ON' or 'OFF' first using query:
mysql>show variables like '%log%';
You can enable it by below commoand without restart
SET GLOBAL slow_query_log = 'ON';
general_log = 1
log=/var/log/mysql_slowquery.log
You can check whether the general_log is 'ON' or 'OFF' first using query:
mysql>show variables like '%log%';
You can enable it by below commoand without restart
SET GLOBAL slow_query_log = 'ON';
No comments:
Post a Comment