Liquid Fire Posted October 24, 2007 Share Posted October 24, 2007 Is there a possible way to log certain mysql queries(basically only update/empty/truncate/delete, stuff the either updates or removes data) and the time that the query was run? I don't want to store select statement since the site runs million of those every few hours. Any help in this would be great. Link to comment https://forums.phpfreaks.com/topic/74599-logging-queries/ Share on other sites More sharing options...
Liquid Fire Posted October 24, 2007 Author Share Posted October 24, 2007 also note the version of mysql running in 4.1.20 Link to comment https://forums.phpfreaks.com/topic/74599-logging-queries/#findComment-377006 Share on other sites More sharing options...
fenway Posted October 24, 2007 Share Posted October 24, 2007 Assuming you have your own DB wrapper class, this is simple... otherwise, there's a query log, but it's binary... Link to comment https://forums.phpfreaks.com/topic/74599-logging-queries/#findComment-377031 Share on other sites More sharing options...
Liquid Fire Posted October 24, 2007 Author Share Posted October 24, 2007 so then i would have to start the server with --log-bin=update.log and mysql with create that file and store any query that might update data Link to comment https://forums.phpfreaks.com/topic/74599-logging-queries/#findComment-377105 Share on other sites More sharing options...
fenway Posted October 24, 2007 Share Posted October 24, 2007 See here -- it will log everything. Link to comment https://forums.phpfreaks.com/topic/74599-logging-queries/#findComment-377139 Share on other sites More sharing options...
Liquid Fire Posted October 25, 2007 Author Share Posted October 25, 2007 I do not want to want to record select statement as they will not cause any issues and there will be millions of them a day, i just want anything that will effect data(delete or update it) Link to comment https://forums.phpfreaks.com/topic/74599-logging-queries/#findComment-377449 Share on other sites More sharing options...
fenway Posted October 25, 2007 Share Posted October 25, 2007 I do not want to want to record select statement as they will not cause any issues and there will be millions of them a day, i just want anything that will effect data(delete or update it) You don't get that choice... you can easily clean up this file regularly... or roll your own. Link to comment https://forums.phpfreaks.com/topic/74599-logging-queries/#findComment-377831 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.