By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,156 Members | 1,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,156 IT Pros & Developers. It's quick & easy.

MySQL won't create a slow query log

P: 2
Posted by Pratchaya:
------------------------------------------------------
MySQL Slow Log ERROR
In my.cnf

i add these lines

#######
log-bin
log-slow-queries = /var/log/mysqld-slow.log
long_query_time=1
#######

But I can't use slow-log
cause i see mysqld.log
i found

########
070211 20:04:25 mysqld started
^G/usr/libexec/mysqld: File '/var/log/mysqld-slow.log' not found
(Errcode: 13)
070211 20:04:25 [ERROR] Could not use /var/log/mysqld-slow.log for
logging (error 13). Turning logging off for the whole duration of the
MySQL server process. To turn it on again: fix the cause, shutdown the
MySQL server and restart it.
/usr/libexec/mysqld: ready for connections.
Version: '4.1.20-log' socket: '/var/lib/mysql/mysql.sock' port: 0
Source distribution
########


but in the directory /var/log i have "mysqld-slow.log" file


Anyone can help me ?
Thank you very much
Prat.


PS. /var/log/

[root@ict log]# ls -l
total 1192
-rw-r----- 1 root root 1037 Feb 9 22:52 acpid
-rw------- 1 root root 15041 Feb 9 18:50 anaconda.log
-rw------- 1 root root 23671 Feb 9 18:50 anaconda.syslog
-rw------- 1 root root 41403 Feb 9 18:50 anaconda.xlog
drwxr-x--- 2 root root 4096 Apr 20 2006 audit
-rw------- 1 root root 1144 Feb 11 20:04 boot.log
-rw------- 1 root root 32335 Feb 11 04:03 boot.log.1
drwxr-xr-x 2 clamav clamav 4096 Feb 11 18:23 clamav
-rw------- 1 root root 49761 Feb 11 21:55 cron
-rw------- 1 root root 90791 Feb 11 04:03 cron.1
drwxr-xr-x 2 lp sys 4096 Feb 11 04:03 cups
-rw-r--r-- 1 root root 17238 Feb 9 22:51 dmesg
drwxr-xr-x 2 root root 4096 Feb 9 18:54 gdm
drwx------ 2 root root 4096 Feb 11 16:11 httpd
-r-------- 1 root root 146584 Feb 11 21:39 lastlog
drwx------ 2 root root 16384 Feb 10 01:34 lost+found
drwxr-xr-x 2 root root 4096 Feb 9 18:38 mail
-rw------- 1 root root 7898 Feb 11 21:30 maillog
-rw------- 1 root root 13381 Feb 11 04:03 maillog.1
-rw------- 1 root root 9139 Feb 11 21:39 messages
-rw------- 1 root root 213732 Feb 11 04:03 messages.1
-rw-r--r-- 1 root root 20448 Feb 11 21:50 mrtg.log
-rw-r----- 1 mysql mysql 7970 Feb 11 20:04 mysqld.log
-rw-r--r-- 1 mysql mysql 0 Feb 11 19:44 mysqld-slow.log
drwx------ 2 root root 4096 Nov 2 2004 ppp
-rw-r--r-- 1 root root 34155 Feb 10 04:02 prelink.log
-rw-r--r-- 1 root root 22816 Feb 11 04:03 rpmpkgs
-rw-r--r-- 1 root root 22816 Feb 10 04:02 rpmpkgs.1
drwx------ 2 root root 4096 Jul 11 2006 samba
-rw-r--r-- 1 root root 63050 Feb 9 18:43 scrollkeeper.log
-rw------- 1 root root 3352 Feb 11 21:39 secure
-rw------- 1 root root 4746 Feb 10 18:04 secure.1
-rw-r--r-- 1 root root 160 Feb 11 04:10 snmpd.log
-rw-r--r-- 1 root root 210 Feb 11 04:03 snmpd.log.1
-rw------- 1 root root 0 Feb 11 04:03 spooler
-rw------- 1 root root 0 Feb 9 18:36 spooler.1
drwxr-x--- 2 squid squid 4096 Nov 23 2005 squid
drwxr-xr-x 2 root root 4096 Oct 5 2004 vbox
-rw------- 1 root root 5067 Feb 11 18:04 vsftpd.log
-rw-rw-r-- 1 root utmp 90240 Feb 11 21:39 wtmp
-rw-r--r-- 1 root root 42734 Feb 9 19:23 Xorg.0.log
-rw-r--r-- 1 root root 34730 Feb 9 19:18 Xorg.0.log.old
Aug 31 '07 #1
Share this Question
Share on Google+
2 Replies


P: 2
I had the same error about slow queries logging file. Maybe it is a bug with resolving
filepath string of log-slow-queries variable, because setting the value just to a file
name solved the problem.
So:
log-slow-queries = /var/log/mysql.slow.log # Does not work!
log-slow-queries = mysql.slow.log # Works! MySQL takes it from {datadir} directory

------------------------------------------------------
MYSQL:
protocol_version 10
version 5.0.27-log
version_bdb Sleepycat Software: Berkeley DB 4.1.24: (October 21, 2006)
version_comment Source distribution
version_compile_machine i686
version_compile_os redhat-linux-gnu
------------------------------------------------------
Aug 31 '07 #2

pbmods
Expert 5K+
P: 5,821
Heya, mezise. Welcome to TSDN!

Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

Make sure the file exists before starting mysqld. For some reason, mysqld doesn't seem to want to create the log files if they don't exist (the exception might be when saving in the data dir).
Aug 31 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.