Create a Database Diagram in MySQL Workbench

It’s helpful to have a visual representation when designing a database. MySQL Workbench allows you to create entity-relation diagrams (ERD’s) and create relationships between the tables – i.e. one to one, one to many – and rearrange them as needed. Below we cover how to create a diagram from a downloaded SQL file.

You can download a SQL file using cPanel Backup Wizard or phpMyAdmin. MySQL Workbench is free to download at dev.mysql.com.

Create a Diagram from a SQL file

  1. Open MySQL Workbench.
  2. Select File and New Model from the top menu.
    Select New Model
  3. Select File, hover over Import, and press Reverse Engineer MySQL Create Script….
    Select Rever Engineer
  4. Specify the SQL file needing a diagram. Press Execute, Next, and then Finish.
    Select file and import options

    Select file and import options

    Press Finish

  5. At this point, you can rearrange and connect tables using the options on the left.
    View the diagram
  6. Once done editing, you can export the diagram as PNG, SVG, PDF, or postscript file.
    Export as PNG
  7. You can view the image as wanted.
    View the diagram image

To create a diagram for a database directly from cPanel, you’ll need to connect MySQL Remote Workbench to your server and ensure port 3306 is open.

Leave a Reply