koopkoop Posted March 13, 2009 Share Posted March 13, 2009 Is there a piece of software out there that can monitor a mysql database and give some kind of output as to what changes have been made? I'm working with a PHP shopping cart (Magento) that has very poor product import support. To get around this, I'm writing my own product import script to inject products, and all of its associated values, directly into the database. However, I need to know exactly how the shopping cart is storing product information. To figure this out, I want to take a "snapshot" of the database before I add a product, then add a product through the shopping cart and then compare the database against the snapshot to see exactly where the shopping cart placed the values. Quote Link to comment https://forums.phpfreaks.com/topic/149291-how-to-track-database-changes/ Share on other sites More sharing options...
samshel Posted March 13, 2009 Share Posted March 13, 2009 if there is a single DB interface for all queries, then u can easily print queries which are fired. else i m not sure if there is any software which does DB monitoring like this , atleast i m not aware. i will keep monitoring this post to see if anybody comes up with a name i will be interested. Quote Link to comment https://forums.phpfreaks.com/topic/149291-how-to-track-database-changes/#findComment-783994 Share on other sites More sharing options...
ionik Posted March 13, 2009 Share Posted March 13, 2009 ah.....great magento, My best regards to you ( I know how much a pain in the a** Magento is ). And the easiest thing you can do is here is log all data written to the database, but since you are using Magento I really wouldn't recommend that as the relations in the database are extremely in-depth. And if you are using 1.2 it should be very simple to export products. And since Magento uses a complete Ajax interface it would be impossiable to profile the DB queries, unless you enable FirePHP for Zend Quote Link to comment https://forums.phpfreaks.com/topic/149291-how-to-track-database-changes/#findComment-784006 Share on other sites More sharing options...
koopkoop Posted March 13, 2009 Author Share Posted March 13, 2009 Print queries isn't practical because the shopping cart is incredibly modular. There's a lot of modules involved which each contribute their small portion of info which makes up the entire info set for a product. It just isn't practical to trace across the hundres of files which comprise all the modules involved in the process. I really need software to do this. My current solution is using WinMerge to compare text file backups between the two database states. It works, but is very slow because of all the manual labour involved. Quote Link to comment https://forums.phpfreaks.com/topic/149291-how-to-track-database-changes/#findComment-784010 Share on other sites More sharing options...
koopkoop Posted March 13, 2009 Author Share Posted March 13, 2009 ah.....great magento, My best regards to you ( I know how much a pain in the a** Magento is ). And the easiest thing you can do is here is log all data written to the database, but since you are using Magento I really wouldn't recommend that as the relations in the database are extremely in-depth. And if you are using 1.2 it should be very simple to export products. And since Magento uses a complete Ajax interface it would be impossiable to profile the DB queries, unless you enable FirePHP for Zend "And the easiest thing you can do is here is log all data written to the database" ^ How exactly would I do that? That's another method that will work too. Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/149291-how-to-track-database-changes/#findComment-784018 Share on other sites More sharing options...
koopkoop Posted March 13, 2009 Author Share Posted March 13, 2009 Hmmm. I think this is the answer: http://dev.mysql.com/doc/refman/5.0/en/query-log.html Can anyone confirm there isn't a better method? Quote Link to comment https://forums.phpfreaks.com/topic/149291-how-to-track-database-changes/#findComment-784019 Share on other sites More sharing options...
ionik Posted March 13, 2009 Share Posted March 13, 2009 Ah sorry I did not explain better Yes, you will need root access to your server to setup the query logger, and this will qrite a log out for queries performed. Because of magento's large database interaction I would recommend waiting to enable this feature until you are ready to insert the product. Little Research. If your running MySQL 5 http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.html this is all you will need Quote Link to comment https://forums.phpfreaks.com/topic/149291-how-to-track-database-changes/#findComment-784025 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.