473,799 Members | 3,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1581
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******@heela l.nl> wrote in message
news:2f******** *************** *********@4ax.c om...
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******@heela l.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******** ************@fe 1.news.blueyond er.co.uk...

"Jonathan" <jo******@heela l.nl> wrote in message
news:2f******** *************** *********@4ax.c om...
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1843
by: Christian.Gruber | last post by:
>Description: It would be nice if general query logging could be switched on and off while the MySQL server is running, and not only at startup time. While debugging an application that uses foreign database access libraries, this would be very helpful. One could switch on logging, perform an activity, switch off logging, and look what has happened. Otherwise, the server has to be restarted to change logging, which is a bit annoying......
0
1888
by: Moritz Steiner | last post by:
Ok, but this only works for the current session, if I close and restart = the client the settings are reset... -----Urspr=FCngliche Nachricht----- Von: Victoria Reznichenko =20 Gesendet: Mittwoch, 16. Juli 2003 11:19 An: mysql@lists.mysql.com Betreff: Re: switch query logging while the server is running
2
1968
by: My SQL | last post by:
Hi Is it possible for me to have the daily updation and insert queries performed on the MySQL DB saved? This will help me track when a particular record was modified in the DB. Is there any other way to track as to when the changes were made to the DB? I also want to add who made the changes but this will come at a
5
1926
by: My SQL | last post by:
Hi, I started the general query log with mysqld --log On my machine this command works fine and every select, update and all statements are logged. I tried the same command on another machine and many many queries are missing, I am running apache, PHP on that machine and all the queries come through the web on localhost.
1
2832
by: Good Man | last post by:
Hi there I've noticed some very weird things happening with my current MySQL setup on my XP Laptop, a development machine. For a while, I have been trying to get the MySQL cache to work. Despite entering the required lines to "my.ini" (the new my.cnf) through notepad AND MySQL Administrator, the cache does not work. So, today I took a peek at the 'Health' tab in MySQL Administrator.
1
2611
by: ZacT1984 | last post by:
Hi, I am trying to set up my mySQL server on FreeBSD to log every query a user runs. I understand I must edit the my.cnf file. But one does not exist for my install. I installed mySQL from the FreeBSD packages and for some reason, it did not create a my.cnf file in /etc or anywhere. Where can I set it up to log every query a user runs?
7
2736
by: Daz | last post by:
Hi. I am trying to select data from two separate MySQL tables, where I cannot use join, but when I put the two select queries into a single query, I get an error telling me to check my syntax. Both of the queries work fine when I use them to query the MySQL server directly. My guess is that the MySQL extension only expects a single resource back from the database, but get's several, or that it just checks the statement first, and decides...
0
6694
by: Chrom_ | last post by:
Mysql is filling my /var partition because the log limit doesn't seem to be respected. I've tried many different settings in /etc/mysql/my.cnf but nothing works. Logrotate is not enabled/configured. I just want mysql to use a maximum of, let's say, 1GB of my /var partition The log is /var/log/mysql/
2
1808
by: Frank Aune | last post by:
Hi, Explaining this problem is quite tricky, but please bear with me. Ive got an application which uses MySQL (InnoDB) for two things: 1. Store and retrieve application data (including viewing the application log) 2. Store the application log produced by the python logging module The connection and cursor for the two tasks are completely separate, and they
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10251
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4141
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 we have to send another system
2
3759
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.