log sql queries?

log sql queries?

am 13.11.2009 17:43:14 von Sydney Puente

OK thanks to some help from this list I now have a blank my.cnf file in /et=
c=0AAnd I want to set up logging of all sql queries. So I have tried:=
SET GLOBAL general_log =3D 'ON'; and/or putting (only) /var/lo=
g/mysql/mysql.log=0Ain my.cnf and doing a restart via /etc/init.d=0A(have a=
pid file now -Ta!) but still no sql commands in the log file. Th=
ere are stop/start up commands in /var/log/mysqld.log but that is abou=
t it Any suggestions? Syd =0A

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: log sql queries?

am 13.11.2009 18:42:55 von John Daisley

Sorry can't remember what version you said you were using; if you have a
version prior to 5.1.29 to log all queries enter the following in the
[mysqld] section of your my.cnf

log = /path/to/logfile/filename.log

Remembering that the path you specify must be writeable by the server.

If you are on version 5.1.29 or later use

general_log=1
general_log_file=/path/to/logfile/filename.log

If you have a very busy server the general query log will get very very
big very quickly. Its best to only enable the general query log for
identifying problems and performance tuning.

Take a look at the manual(http://dev.mysql.com/doc/refman/5.1/en/)! You
can get answers to questions like this so much quicker from there.

Regards

John Daisley


On Fri, 2009-11-13 at 16:43 +0000, Sydney Puente wrote:
> OK thanks to some help from this list I now have a blank my.cnf file in /etc
> And I want to set up logging of all sql queries.
>
> So I have tried:
>
> SET GLOBAL general_log = 'ON';
>
> and/or putting (only) /var/log/mysql/mysql.log
> in my.cnf and doing a restart via /etc/init.d
> (have a pid file now -Ta!)
>
> but still no sql commands in the log file.
>
> There are stop/start up commands in /var/log/mysqld.log
>
> but that is about it
>
> Any suggestions?
>
> Syd
>
>
>
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: log sql queries?

am 15.11.2009 13:57:59 von Sydney Puente

Ah! Thanks - I see. 5.1.39=0AActually I did look i the manual, but failed =
to note the differences between < 5.1.29 and > 5.1.29 =0AI was using the=
syntax for < 5.1.29. Now I am using the correct syntax in /etc/my.cnf=
=0A$ grep general /etc/my.cnf=0Ageneral_log=3D1=0Ageneral_log_file=3D/var/l=
og/mysql/mysql.log Now I get a log file, but no actual sql commands ap=
pear within.=0A$ tail -f mysql.log=0A/usr/sbin/mysqld, Version: 5.1.39-comm=
unity-log (MySQL Community Server (GPL)). started with:=0ATcp port: 3306 U=
nix socket: /var/lib/mysql/mysql.sock=0ATime Id Command =
Argument =0ACant see anything relevant in the manual. Strange(?)=
Syd =0A++++++++++++++++++=0ASorry can't remember what version you sai=
d you were using; if you have a=0Aversion prior to 5.1.29 to log all querie=
s enter the following in the=0A[mysqld] section of your my.cnf log =3D=
/path/to/logfile/filename.log Remembering that the path you specify m=
ust be writeable by the server. If you are on version 5.1.29 or later=
use general_log=3D1=0Ageneral_log_file=3D/path/to/logfi le/filename.lo=
g If you have a very busy server the general query log will get very v=
ery=0Abig very quickly. Its best to only enable the general query log for=
=0Aidentifying problems and performance tuning. Take a look at the man=
ual(http://dev.mysql.com/doc/refman/5.1/en/)! You=0Acan get answers to ques=
tions like this so much quicker from there. Regards John Daisley=
=0AOn Fri, 2009-11-13 at 16:43 +0000, Sydney Puente wrote:=0A> OK tha=
nks to some help from this list I now have a blank my.cnf file in /etc=0A> =
And I want to set up logging of all sql queries.=0A> =0A> So I have tried:=
=0A> =0A> SET GLOBAL general_log =3D 'ON';=0A> =0A> and/or putting (only) =
/var/log/mysql/mysql.log=0A> in my.cnf and doing a restart via /etc/init.d=
=0A> (have a pid file now -Ta!)=0A> =0A> but still no sql commands in the l=
og file.=0A> =0A> There are stop/start up commands in /var/log/mysqld.log=
=0A> =0A> but that is about it=0A> =0A> Any suggestions?=0A> =0A> Syd =


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg