MySQL лог SQL запросов

Добавьте следующие строки в MySQL конфиг(my.cnf), для того, что бы начать собирать логи запросов:

slow-query-log
log-output = TABLE
long_query_time = 1
general-log
expire_logs_days = 1

ну и примеры запросов для получения логов:

select * from mysql.general_log order by event_time desc limit 10;
select * from mysql.slow_log order by start_time desc limit 10;

Leave a Reply

Ваш адрес email не будет опубликован. Обязательные поля помечены *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>