Добрый день,Empty Slow Query Log
мы пытаемся получить доступ к нашему файлу журнала медленно запросов на «/var/log/mysql/localhost-slow.log», но это выглядит как файл пуст. Файл «my.cnf» говорит, и внутри этого каталога мы имеем следующие файлы «includedir /etc/my.cnf.d!»:
mysql-clients.cnf;
server.cnf;
tokudb.cnf;
Глядя на «server.cnf» файл, он выглядит он правильно настроен писать медленные запросы журналы:
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
slow-query-log = 1
slow-query-log-file = /var/log/mysql/localhost-slow.log
long_query_time = 1
log-queries-not-using-indexes
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
[mariadb-5.5]
Мы попытались установить глобальные general_log = «ON»; но это не помогло. Любая идея о том, что может быть проблемой?
Рик, спасибо это вход: 'Параметры по умолчанию считываются из следующих файлов в заданном порядке: /etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf' - Означает ли это, что вы не читаете server.cnf? – Lightbox
Мы запускаем 'show variables, такие как '% log%';' также и все выглядит нормально: ' 10 slow_query_log | ON slow_query_log_file | /var/log/mysql/localhost-slow.log long_query_time | 1.000000 min_examined_row_limit | 100 ' Мы также запускаем' select sleep (2); ', а затем' show status like Slow_queries ';, но результат был следующим: 'Slow_queries | 0' – Lightbox
'min_examined_row_limit = 100' отфильтровывает ваш сон. –