ER diagrams are very powerful tool which helps Database Administrators, programmers and software architects. Generating such diagrams for MySQL is failry easy task if you have some tools at your disposal like MySQL Workbench, Dbeaver etc.

In this post(for Windows and Linux:

  • Generate Database Diagram MySQL with MySQL Workbench
  • Generate Database Diagram MySQL with Dbeaver

Generate Database Diagram MySQL with MySQL Workbench

  • Start MySQL Workbench
  • connect to your database (check here from more information: Remote Connection to MySQL with SSH tunnel to Ubuntu 16
  • Tab Database
  • Select Reverse Engineer
  • Follow the steps ( Next - if no changes):
  • Connect to DBMS - setup Connection settings - if needed
  • Select schemata
  • Fetch Object Info
  • Select Objects - select tables for these reverse engineering if needed
  • Reverse Engineer
  • Results
  • Finnish
  • You can rearrange tables and edit them.

Note: Have in mind MySQL Workbench draw relationships in diagrams from existing foreign keys. If your tables use engines (MyISAM) that don't support or don't have foreign keys no relationships can be visible.

Generate Database Diagram MySQL with Dbeaver

  • open the DBeaver application
  • connect to your database (check here from more information: Remote Connection to MySQL with SSH tunnel to Ubuntu 16
  • Right click on schema - the one that you want to reverse engineer as ER Diagram
  • Select Edit Database or F4
  • Go to tab Diagram
  • You can rearrange tables and edit them
  • Print is available by CTRL + P

Note: you will see relation only for InnoDB databases. For MyISAM since their different architecture relations are not available but you still can generate a diagram