Answer the question
In order to leave comments, you need to log in
Slow_query_log_file (MariaDB) is not being written, I did research, I didn't get to the bottom, can you help?
I have ubuntu 14.04 and MariaDB 10.0.30.
In the /etc/mysql/my.cnf file I configured:
slow_query_log=1
slow_query_log_file = /var/log/mysql/mariadb-slow.log
long_query_time = 10
#log_slow_rate_limit = 1000
log_slow_verbosity = query_plan
SHOW GLOBAL STATUS;
show variables like '%slow%';
SHOW VARIABLES LIKE '%log_output%';
- everything is correct here log_output=FILE set global log_queries_not_using_indexes = 'ON'
, waited, the counter of slow queries that I look through SHOW GLOBAL STATUS;
increased, but the master-slow.log and /var/log/mysql/mariadb-slow.log files are still missing!set global slow_query_log_file = /var/log/mysql/mariadb-slow.log
And the file did appear! This removed the suspicion that there was a problem accessing the /var/log/mysql/ folder. But for now, the question remains why, when the server starts, the same value is not taken from my.cnf !includedir /etc/mysql/conf.d/
, I looked that in the /etc/mysql/conf.d/ folder - there are three files mariadb.cnf mysqld_safe_syslog.cnf tokudb.cnf, but inside there are no overwriting settings associated with slow queries log_queries_not_using_indexes
, which I wrote above turned out to be wrong, I clarify the situation so that others do not get confused after reading this epic: Answer the question
In order to leave comments, you need to log in
1. When changing the config, you need to reload / restart mysql.
2. Through the search, find the file where the logs are now being written
3. Check the directory where the logs should be located for the presence of write permissions for the Mysql user.
4. my.cnf can be located not only in /etc/mysql, see if there is a config that overwrites your settings find / -name 'master-slow.log'
For those who faced the same problem and found this thread in 2021.
You must specify the option WITHOUT "= 1" in the configuration file:
slow_query_log
https://mariadb.com/kb/en/slow-query-log-overview/
Config path for OS Debian 10, MariaDB 10.3.27
/etc/mysql/mariadb. conf.d/50-server.cnf
Block[mysqld]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question