Created
January 9, 2019 15:23
-
-
Save Nex-Otaku/df81787890bb0787fa28710990f4eb41 to your computer and use it in GitHub Desktop.
Логирование медленных запросов MySQL 5.7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/mysql/mysql.conf.d/mysqld.cnf | |
[mysqld] | |
# Логирование медленных запросов. | |
# Включаем логирование медленных SQL-запросов. | |
slow_query_log = 1 | |
# Пишем лог во временный файл. | |
slow_query_log_file = /tmp/slow_query.log | |
# Логируем все запросы, выполняющиеся дольше двух секунд. | |
long_query_time = 2 | |
# Логируем запросы, не использующие индексы. | |
log_queries_not_using_indexes = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment