Category Image Comparing the Structure of two Versions of a Database


If you are actively doing local development on your Powerbook or Desktop and you need to upgrade a production database to the same structure before you redeploy your revised web application, it may be useful to first compare database structures using this simple tip....

Open terminal or log in via ssh to the production database server.

Dump the database STRUCTURE ONLY
% mysqldump -u root -p --databases --opt --no-data mydb > /Users/admin/mydb_production_structure.sql

Copy the database structure sql file to your own computer's home folder using scp or whatever method you wish.

Using similar command as above, dump the structure of the local development version of the database

Compare the two text files using the FileMerge app in /Developer/Applications/Utilities/



... in the example screenshot here, FileMerge found 18 differences. There is nothing worse than deploying your new web app only to find it does not work properly because of a database field you forgot to add to the production database!

Posted: Thursday - February 24, 2005 at 07:56 AM        


Published by