CyJobes Posted March 23, 2009 Share Posted March 23, 2009 I have two tables that are identical in fields. rate_info_stndby - used to edit site in an admin before going live rate_info - live table used on site I need a fast and easy way to compare the tables and find out what is different between the two. This way I can create a list of inserts, updates or deletes. Once table are in sync they are, of course, identical in data. However, the rate_info_stndby table is accessed only by the admin and can change in data entry, new rows or deleted rows. Finding these differences is what I need to alert the admin that the tables are no longer in sync, and to use the info to create the SYNC script. I've worked with MySQL for a while, but not very deep. I just finished a "MySQL for Developers" course, but joins went way over my head. Any help would be appreciated. Thanks, Cy Quote Link to comment https://forums.phpfreaks.com/topic/150771-compare-tables/ Share on other sites More sharing options...
Maq Posted March 23, 2009 Share Posted March 23, 2009 Found this code snippet off the mysql website: mysqldump -l -B db1 > db1.sql mysqldump -l -B db2 > db2.sql diff db1.sql db2.sql > diff.sql Of course you can add tables in for your cause. Link, http://lists.mysql.com/mysql/190020. Hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/150771-compare-tables/#findComment-792128 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.