In my CentOS machine I use MySQL 5.5.30. (I rented server two days ago and I'm newbie in Linux commands)
I'm trying to check for slow MySQL queries. So I made this from phpMyAdmin
SET GLOBAL log_slow_queries = ON;
SET GLOBAL slow_launch_time = 1;
FLUSH LOGS;
And in default configuration slow query log file variable is /var/lib/mysql/srv1-slow.log
But when I check /var/ folder with FTP, there exists only /var/tmp/ folder. which is empty. What should I do more to see slow queries log?
Note: I tried to create /var/lib folder but system didn't let me.
Add following lines in /etc/my.cnf and restart mysql:
Notes: In my case MySQL version is 5.0.x
[mysqld]
log-slow-queries = /var/lib/mysql/sev1-slow.log
long_query_time = 1
In MySQL 5.5 version
[mysqld]
slow_query_log_file= = /var/lib/mysql/sev1-slow.log
long_query_time = 1
slow_query_log = 1
You must create the file manually and change owners this way:
mkdir /var/lib/mysql
touch /var/lib/mysql/sev1-slow.log
chown mysql.mysql -R /var/lib/mysql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With