MySQL slow query log and turn ordinary log

First, open the full query log

1, see the slow query log

SHOW VARIABLES LIKE '%slow%';

2, turn on slow query log

set GLOBAL slow_query_log =on;

3, set the slow query log file and save path

set GLOBAL slow_query_log_file='/tmp/mysql_slow.log';

4, set the slow query log time

set GLOBAL long_query_time=1;

 

Second, open the general log

1, the general view log

SHOW VARIABLES LIKE 'general%';

2, open the general log

set GLOBAL general_log='ON';

3, change the general log storage path

set global general_log_file='/u02/mysql/generallog/node0.log';

 

Guess you like

Origin www.cnblogs.com/xibuhaohao/p/11897858.html