P
P
polevsl2011-10-12 22:23:32
MySQL
polevsl, 2011-10-12 22:23:32

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

8 answer(s)
S
Stalker_RED, 2011-10-13
@polevsl

I did this once to synchronize the structure of the database.
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.
© I
, well, in general, the article itself , and comments on it once again on this topic.

L
lafayette, 2011-10-12
@lafayette

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

Z
zzr, 2011-10-13
@zzr

SchemaSync for mysql
works from the console, generates direct and revert patches describing the difference between the databases, which can be applied immediately.

O
overherz, 2015-07-09
@overherz

https://www.devart.com
can be used for free for yourself , it's a
pity that only under Windows

D
DVLev, 2015-10-13
@DVLev

You can use Compalex
Free and works on any platform.
Demo here demo.compalex.net

K
knekrasov, 2011-10-12
@knekrasov

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).

G
Gibbzy, 2011-10-13
@gibbzy

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.

R
Roman Gogolev, 2011-10-13
@romka777

Navicat has a structure synchronization function between two databases - tables, indexes, triggers, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question