1

I'm trying to log mysql slow queries, but I can't turn it on.

I will explain all my steps:

Open and Edit my.cnf and add the following lines:

long_query_time = 5 slow_query_log_file = /myfolder/slowq.log log_slow_queries = 1 =>(I have MySQL 5.0.7) 

Give mysql user permitions to write on the file:

chown -R mysql:mysql /var/lib/mysql 

Create the file:

touch /myfolder/slowq.log 

Chmod for this file to 777.

service mysqld restart 

From MySQL Admin Panel I can see that the "log_slow_queries" var is OFF! Also no logs are created.

Thanks in advance! Best Regards, Panos.

1 Answer 1

1

into my.cnf write this under mysqld then you need to restart the server(mysql) also make sure you can write int the directory where you want to log

[mysqld] log-slow-queries=/var/log/mysqld-slow-queries.log 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.