MySQL Workbench - How to synchronize the EER Diagram

喜夏-厌秋 提交于 2019-12-03 02:37:11

问题


I am creating a visual representation of my existing database with MySQL Workbench and I am able to synchronize the models with the "Database -> Synchronize Model..." menu. However, every time I synchronize (update) my model, I have to recreate the EER Diagram and rearrange all the tables. Is there a way to update or synchronize the EER Diagram as well? Thanks.


回答1:


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



回答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.




回答3:


When I have more than 3 tables to sync, with changes on relations, I changes arrow direction (model <- source), I check "Skip DB changes and update model only" and Execute...

The "Progress of Model and Database Synchronization" window hang with "Apply changes to Model" highlighted. No processor working, nothing move...

I click the X of the window and redo the process again. Clicking the DB, ignore (all), and selecting less tables to update.

v.5.2.44 ce rev 9933

EDIT: Version 5.2.47 correct this bug !!! Yé !




回答4:


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



来源:https://stackoverflow.com/questions/2410164/mysql-workbench-how-to-synchronize-the-eer-diagram

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!