Create a Database Diagram in MySQL Workbench

Create a Database Diagram in MySQL Workbench

It is helpful to have a visual representation when designing a database. MySQL Workbench allows you to create entity relationship diagrams (ERDs) with relationships between the tables (one to one, one to many) and rearrange them as needed. Below we cover how to create an ERD from a downloaded SQL file.

Create a Diagram from a SQL File

  1. If using a database on your server, download the SQL file using cPanel Backup Wizard or phpMyAdmin.
  2. Download MySQL Workbench for free at dev.mysql.com and install it on your local machine.
  3. Open MySQL Workbench.
  4. Select File and New Model from the top menu.
    Create a new model in MySQL Workbench
  5. Select File, hover over Import, and press Reverse Engineer MySQL Create Script….
    Reverse engineer a MySQL file
  6. Specify the SQL file needing a diagram. Press Execute, Next, and then Finish.
    Select a file in MySQL Workbench
     
    Finish in MySQL Workbench
  7. At this point, you can rearrange and connect tables using the options on the left.
    ERD in MySQL Workbench
  8. Once you’re done editing, you can export the diagram as PNG, SVG, PDF, or postscript file.
    Export images in MySQL Workbench
  9. View the exported image to check results.
    Saved ERD in MySQL Workbench

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.

J
Jacqueem Content Writer I

Technical writer focused on cybersecurity and musicianship.

More Articles by Jacqueem

Comments

It looks like this article doesn't have any comments yet - you can be the first. If you have any comments or questions, start the conversation!

Was this article helpful? Let us know!