The easiest way to see the differences between two schemas on a non-Windows machine is to run:
mysqldump -h server1 --no-data --all-databases >
file1.sql
mysqldump -h server2 --no-data --all-databases >
file2.sql
diff file1.sql file2.sql
However, this will show also trivial differences, such as the
value of AUTO_INCREMENT
. It also does not give you a
way to patch one schema to be like another.
We frequently are asked to “do a schema diff and create a script that will ‘patch’ one server.” Usually this is done to take a development or test schema and move it to production for a release.
We like to use the best tool for the job, and while diff is good, I like to use MySQL workbench. The OSS (Community) edition provides all the functionality we need for creating a schema diff and …
[Read more]