Answer the question
In order to leave comments, you need to log in
How to compare structures of two MySQL databases?
Hello everyone!
There are 2 bases, almost identical in structure, but with some differences.
Tell me more or less simple (ready-made) ways to compare bases?
www.sqlmanager.net/en/products/studio/mysql I know, but my poppy and virtual Windows are not installed. And it's urgent.
Maybe php scripts are ready-made or online services.
I can't find anything useful on the Internet.
Thank you!
Answer the question
In order to leave comments, you need to log in
I did this once to synchronize the structure of the database.© I
without version control, of course, but it can add / change tables and fields.
in principle, no one bothers to attach logs, backups, creating alters / diffs in the form of separate files and other goodies there, but at the time of writing this was not necessary.
deletion of tables and fields is missing intentionally, and not from laziness, written with the left back foot in the best traditions of php-noodles :).
yes, I hastily removed the dependencies from there, but there is nowhere to test now, so I could break it a little.
It will help to dump only the structures of both databases (without data) and compare them with any utility for comparing text files.
Structure dump is done like this:
mysqldump -d -u root -p databasename > databasename.sql
SchemaSync for mysql
works from the console, generates direct and revert patches describing the difference between the databases, which can be applied immediately.
https://www.devart.com
can be used for free for yourself , it's a
pity that only under Windows
You can use Compalex
Free and works on any platform.
Demo here demo.compalex.net
In general, an interesting idea for the Just for fun puzzle.
Although in fact it is not entirely clear what you need to get in the end: just a report on the missing fields (assuming the table names match) or a comprehensive analysis of relationship graphs (plus a search for matches between the tables of two databases).
I have a crazy idea)
We take the mysql workbench program. From the first base we build Err - a diagram, therefore we are trying to roll this diagram onto the second base, in the process this wonderful program should show the differences in the bases and what it wants to change.
Navicat has a structure synchronization function between two databases - tables, indexes, triggers, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question