How to Schema Diff two databases using MySQL Workbench?
Asked Answered
K

6

32

Does anyone know how to pull a database Scheme Diff for two databases using MySQL Workbench. v5.2 states it has this feature, but I can't seem to find it. I must use MySQL Workbench.

Koel answered 20/4, 2012 at 14:20 Comment(2)
You may want to take a look at [this][1]. [1]: https://mcmap.net/q/41499/-compare-two-mysql-databases-closedFerren
How about with MySQL Workbench?Koel
B
18

The database diff tool is part of the MySQL Utilities that you can access through MySQL Workbench in Plugins -> Start Shell for MySQL Utilities. You can find the relevant documentation here.

Bemba answered 20/4, 2012 at 14:46 Comment(1)
The mysqldbcompare tool, which uses mysqldiff I think, may be a better option for a whole database. I'm using --run-all-tests --skip-row-count --skip-data-check options to get only schema differences. Only downside I see so far is it just notifies of any objects missing in one of the databases rather than providing CREATE statements when using --difftype=sql.Glindaglinka
A
41

If you don't see this option directly you have to:

  1. Click File and New model
  2. On the new model window which has been opened, click Database and Compare schemas.
Antinomian answered 20/7, 2017 at 9:39 Comment(1)
this gives a report only about the differences is there any way to generate a script on apply these to the DB directlyKatekatee
B
18

The database diff tool is part of the MySQL Utilities that you can access through MySQL Workbench in Plugins -> Start Shell for MySQL Utilities. You can find the relevant documentation here.

Bemba answered 20/4, 2012 at 14:46 Comment(1)
The mysqldbcompare tool, which uses mysqldiff I think, may be a better option for a whole database. I'm using --run-all-tests --skip-row-count --skip-data-check options to get only schema differences. Only downside I see so far is it just notifies of any objects missing in one of the databases rather than providing CREATE statements when using --difftype=sql.Glindaglinka
G
16

Just go to File->New Model, then Database -> Synchronize with any source. You have to be in model view to see this option in the Database menu.

Geny answered 4/1, 2015 at 19:8 Comment(0)
M
6

you can open "Model view"

enter image description here

and choose "Compare schemas" option

enter image description here

Mikamikado answered 17/10, 2016 at 6:58 Comment(3)
This menu option is not available until after generating an EER Diagram. Maybe explain how where Model View is?Benzoin
Don't have to create an EER diagram. Just click New Model and then go to mentioned option.Melquist
You wont get this menu unless you follow these steps Just go to File->New Model>Databases>Compare...Dichroism
F
2

You can follow the steps below:

1 - Menu File / New Model

enter image description here

2 - After opening the other screen, open the menu Database / Compare Schemas

enter image description here

3 - Select the option Live Database Server in both Source and Destination sections, then press on the Next button (My case I would compare 2 databases from cloud server)

enter image description here

4 - Select the stored connection for the Source Database (If the connection string is not created yet, you can create one), then press the Next button

enter image description here

5 - Select the stored connection for the Target Database (If the connection string is not created yet, then you can also create one), then press the Next button

enter image description here

6 - Click on the Next button

enter image description here

7 - Click on the schemas you want to compare in both sides: Source and Target, then press the Next button

enter image description here

8 - Wait until this step is complete and then press the Next button

enter image description here

9 - Finally check the results, you can copy and paste it outside for a better review

enter image description here

Footling answered 2/12, 2023 at 16:47 Comment(0)
R
0

I have developed a tool that can be used to compare two Databases. This Tool only works with MySQL. This tool generates SQL for Target Database to sync the database. This is a web application tool built in CakePHP 2, you have to download code put into xammp->htdocs in case of windows, and make a virtual domain before using it. For more information goto below Link

https://github.com/hardeepvicky/MySql-Schema-Compare

Rica answered 13/7, 2022 at 12:31 Comment(2)
Sir, I edit the answer as you commented. This is a free tool, just want to make an easy database syncing process.Rica
Thanks. I think that looks like a better answerFonteyn

© 2022 - 2024 — McMap. All rights reserved.