• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How to enable slow query log

K

Konstantin2

Guest
Hello, I added a line to my.cnf to log slow queries, but the log is not being created. I pointed it to /var/log/ and called it mysql-slow.log but nothing. I tried to create the file manually but it didnt save in that folder.

What am I doing wrong? (using fedora core6).
 
Create the file
Code:
touch /var/log/mysql-slow.log 
chmod 644 /var/log/mysql-slow.log 
chown root:root /var/log/mysql-slow.log

Then in the /etc/my.cnf under the [mysqld_safe] or [mysqld] section
Code:
log-slow-queries=/var/log/mysql-slow.log

if its not saving anything then perhaps you have nothing to save :)
 
Back
Top