2016-04-01 2 views
1

Добрый день,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»; но это не помогло. Любая идея о том, что может быть проблемой?

ответ

0

Убедитесь, что он действительно читает этот файл:

mysqld --verbose --help | head -33 

Вы, вероятно, увидеть

Default options are read from the following files in the given order: 

следует список путей файлов.

+0

Рик, спасибо это вход: 'Параметры по умолчанию считываются из следующих файлов в заданном порядке: /etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf' - Означает ли это, что вы не читаете server.cnf? – Lightbox

+0

Мы запускаем '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

+0

'min_examined_row_limit = 100' отфильтровывает ваш сон. –