30

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,186
  • 7
  • 38
  • 64

4 Answers4

34

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,245
  • 9
  • 60
  • 100
  • 3
    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
  • 845
  • 6
  • 21
Sergio
  • 4,397
  • 3
  • 32
  • 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
15

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
  • 481
  • 5
  • 9
4

you can open "Model view"

enter image description here

and choose "Compare schemas" option

enter image description here

jmhostalet
  • 3,961
  • 4
  • 36
  • 42
  • 2
    This menu option is not available until after generating an EER Diagram. Maybe explain how where Model View is? – Master James Jan 24 '17 at 09:22
  • 1
    Don't have to create an EER diagram. Just click New Model and then go to mentioned option. – M_R_K Feb 15 '21 at 02:03