31

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.

jjwdesign
  • 3,272
  • 8
  • 41
  • 66

5 Answers5

36

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.
Avión
  • 7,963
  • 11
  • 64
  • 105
  • 4
    this gives a report only about the differences is there any way to generate a script on apply these to the DB directly – AnAs51993 Mar 01 '19 at 18:54
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.

topshot
  • 885
  • 6
  • 21
Sergio
  • 4,537
  • 4
  • 33
  • 41
  • 1
    The [`mysqldbcompare`](https://docs.oracle.com/cd/E17952_01/mysql-utilities-1.6-en/mysqldbcompare.html) 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`. – topshot Sep 21 '18 at 20:44
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.

Max
  • 541
  • 6
  • 9
6

you can open "Model view"

enter image description here

and choose "Compare schemas" option

enter image description here

jmhostalet
  • 4,399
  • 4
  • 38
  • 47
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

Hardeep Singh
  • 743
  • 1
  • 8
  • 18