473,503 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySQL won't create a slow query log

2 New Member
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
2 10891
mezise
2 New Member
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
5,821 Recognized Expert Expert
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

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

Similar topics

0
1702
by: John R | last post by:
I found this old thread while looking for some type of compression solution myself. Long story short, I contacted Lester and ended up writing an LZO solution just as Mark had mentioned below....
0
3924
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
11
17524
by: DJJ | last post by:
I am using the MySQL ODBC 3.51 driver to link three relatively small MySQL tables to a Microsoft Access 2003 database. I am finding that the data from the MySQL tables takes a hell of a long time...
4
18679
by: Gordon Burditt | last post by:
What's the easiest way to copy a row from one table to another (with the same schema), without knowing in advance the number and types of the columns? The problem: I have several sets of tables...
1
3358
by: jlee | last post by:
I'm pretty much a newbie on mysql, and I need some help. I am running mysql Ver 12.22 Distrib 4.0.24, for portbld-freebsd5.4 (i386) on a server hosting an active website. The site's developer...
0
6615
by: Bucker | last post by:
Could someone view the following that I copied from phpMyAdmin and tell me from the statistics if are server is running OK? Does it look like we will have problems as more people hit our server?...
8
2000
by: Daz | last post by:
Hi everyone. I was faced with the choice of whether my problem is indeed a PHP problem or a MySQL. I have decided it's a PHP problem as I don't experience the same problem when I execute the...
9
1985
by: Derrick Shields | last post by:
I'm working with a database that has over 11 million rows. The .SQL drop file is about 2.5gigs. Doing a simple query: select * from people where last_name like '%smith%' A query like this can...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1501
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.