471,123 Members | 822 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,123 software developers and data experts.

Logging Queries on MYSQL

CK
Hi all

I am running Red Hat and MySQL, I am needing to make it that mysql logs all
queries done on the server, at the moment my /etc/my.cnf file looks like
this.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
[mysql]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

What do I need to do to accompish this , I have looked on google and just
cant find the answer at all to this.

Thanks in advance

--
Kind Regards
www.ckconsultants.co.uk
Jul 23 '05 #1
4 1503
On Fri, 14 Jan 2005 16:33:26 GMT, "CK" <pu***@pxfernyz.pbz> wrote:
Hi all

I am running Red Hat and MySQL, I am needing to make it that mysql logs all
queries done on the server, at the moment my /etc/my.cnf file looks like
this.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
[mysql]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

What do I need to do to accompish this , I have looked on google and just
cant find the answer at all to this.

Thanks in advance


Whiy not us e binary logging.

For starters just enter the following line in you configuration file:

log-bin

and have a look here:
http://dev.mysql.com/doc/mysql/en/Binary_log.html

If you have further questions just get back and ask!

Good luck!

Jonathan

Jul 23 '05 #2
CK

"Jonathan" <jo******@heelal.nl> wrote in message
news:2f********************************@4ax.com...
On Fri, 14 Jan 2005 16:33:26 GMT, "CK" <pu***@pxfernyz.pbz> wrote:
Hi all

I am running Red Hat and MySQL, I am needing to make it that mysql logs
all
queries done on the server, at the moment my /etc/my.cnf file looks like
this.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
[mysql]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

What do I need to do to accompish this , I have looked on google and just
cant find the answer at all to this.

Thanks in advance


Whiy not us e binary logging.

For starters just enter the following line in you configuration file:

log-bin

and have a look here:
http://dev.mysql.com/doc/mysql/en/Binary_log.html

If you have further questions just get back and ask!

Good luck!

Jonathan

Tried that still cant seem to get it logging at all,

--
Kind Regards

www.ckconsultants.co.uk
Jul 23 '05 #3
On Fri, 14 Jan 2005 17:19:49 GMT, "CK" <pu***@pxfernyz.pbz> wrote:

"Jonathan" <jo******@heelal.nl> wrote in message
news:2f********************************@4ax.com.. .
On Fri, 14 Jan 2005 16:33:26 GMT, "CK" <pu***@pxfernyz.pbz> wrote:

cut
Whiy not us e binary logging.

For starters just enter the following line in you configuration file:

log-bin

and have a look here:
http://dev.mysql.com/doc/mysql/en/Binary_log.html

If you have further questions just get back and ask!

Good luck!

Jonathan

Tried that still cant seem to get it logging at all,


How do you mean can't seem to get it logging at all?

If it is working there should be some extra files in your data dir.
They should be called something like <server name>-xxx.bin or
something like that.

You could be able to view them with mysqlbinlog a tool that is in your
mysql/bin directory. The manual will tell you how to do so...
hopefully you will get some results as I got to go now. Will check
back later!

Jonathan
Jul 23 '05 #4
Are you restarting mysql when you make the change? Changes to config files
won't take effect until the server is restarted.

Thanks,
Shane

"CK" <pu***@pxfernyz.pbz> wrote in message
news:Va********************@fe1.news.blueyonder.co .uk...

"Jonathan" <jo******@heelal.nl> wrote in message
news:2f********************************@4ax.com...
On Fri, 14 Jan 2005 16:33:26 GMT, "CK" <pu***@pxfernyz.pbz> wrote:
Hi all

I am running Red Hat and MySQL, I am needing to make it that mysql logs
all
queries done on the server, at the moment my /etc/my.cnf file looks like
this.

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
[mysql]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

What do I need to do to accompish this , I have looked on google and justcant find the answer at all to this.

Thanks in advance


Whiy not us e binary logging.

For starters just enter the following line in you configuration file:

log-bin

and have a look here:
http://dev.mysql.com/doc/mysql/en/Binary_log.html

If you have further questions just get back and ask!

Good luck!

Jonathan

Tried that still cant seem to get it logging at all,

--
Kind Regards

www.ckconsultants.co.uk

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Christian.Gruber | last post: by
reply views Thread by Moritz Steiner | last post: by
2 posts views Thread by My SQL | last post: by
5 posts views Thread by My SQL | last post: by
1 post views Thread by ZacT1984 | last post: by
reply views Thread by Chrom_ | last post: by

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.