MySQL Workbench - How to synchronize the EER Diagram

Solution 1:

  • Database > Synchronize Model...
  • Choose Stored Connection
  • Select the Schemata
  • Choose which to update: Model or Source (in your case, point arrows to Model)

Solution 2:

Are you by any chance using a MySQL DB engine that doesn't support foreign keys (e.g. MyISAM?)? Hence, the relations between the tables is not saved on the MySQL server and get lost during synchronization to the workbench.

But I realize this is only the 'why' of your question. I cannot provide an answer that would preserve your arrangement without using an engine that supports foreign keys, e.g. InnoDB.

Solution 3:

I was having a variant of this problem--somehow when I would update the model from the database, one of my tables and its corresponding updatable view wouldn't update.

I believe what was happening is that the model was actually updating, but not the diagram. I didn't really make the distinction at first.

Anyway here's how to get the refresh on the E/R diagram:

  1. Delete the nonupdating object(s) from the diagram. (Just right click and choose "Delete".)
  2. Find the objects in the catalog view in the left sidebar.
  3. Drag them back onto the diagram.

Now they should reflect the model (which should reflect the DB if you followed the accepted answer above.)