Guilherme Ruiz
Guilherme Ruiz

Reputation: 186

Compare two database's structure in MySQL

I need compare the structure of two MySQL databases and something show me what is the difference between they.

Anyone knows any way for this?

Thank you in advance.

Upvotes: 0

Views: 1831

Answers (1)

spencer7593
spencer7593

Reputation: 108450

If you are looking to confirm the structures are identical, then one rudimentary way to do this is to run a mysqldump --no-data on each database, and then compare the output files, using e.g. diff. That's not necessarily the best way to do it, but if you are just checking to see if there are any differences, then it's workable.

I use a third-party tool (DB Solo) to perform schema compares, this produces output in a much more robust format/interface, and is useful when there are lots of differences and I want to visualize/investigate.

(I have the community edition of SQLyog; I believe the Enterrprise edition has a Schema Synchronization tool.)

Upvotes: 3

Related Questions