Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logging only insert, update and delete mysql queries

Tags:

logging

mysql

I'm using a WAMP server with phpmyadmin and MySQL 5.0. I've been looking for a way to only log all insert, update and delete queries, to no avail though.

I did manage to get it to auto generate logs adding the "log=C:\wamp\mysql\log\queries.log" line to the my.ini configuration file of mysql, but the log didn't log the exact queries.

What i'm trying is that, whenever an insert, delete or update query happens, it logs the query in a file or in another table. Is this possible with procedures? What are my choices?

like image 853
Arthur Avatar asked Sep 28 '11 17:09

Arthur


1 Answers

This is achieved through the Binary Log . You enable it using the log-bin parameter.
You can read the contents of a binary log using this utility, the mysqlbinlog .

like image 149
georgepsarakis Avatar answered Oct 07 '22 16:10

georgepsarakis