---
title: "Create a Database Diagram in MySQL Workbench"
description: "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,..."
url: https://www.inmotionhosting.com/support/website/create-diagram-in-mysql-workbench/
date: 2018-10-24
modified: 2022-03-01
author: "InMotion Hosting Contributor"
categories: ["Website", "Working with Databases"]
type: post
lang: en
---

# Create a Database Diagram in MySQL Workbench

![Create a Database Diagram in MySQL Workbench](https://www.inmotionhosting.com/support/wp-content/uploads/2018/10/mysql-workbench-database-diagram-1024x538.jpg)

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](https://www.inmotionhosting.com/support/server/databases/export-database-using-phpmyadmin/).
2. Download MySQL Workbench for free at [dev.mysql.com](https://dev.mysql.com/downloads/workbench/) 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](https://www.inmotionhosting.com/support/wp-content/uploads/2018/10/mysql-workbench-8-new-model.png)
5. Select **File**, hover over **Import**, and press **Reverse Engineer MySQL Create Script…**.![Reverse engineer a MySQL file](https://www.inmotionhosting.com/support/wp-content/uploads/2018/10/mysql-workbench-9-reverse-engineer-file.png)
6. Specify the SQL file needing a diagram. Press **Execute**, **Next**, and then **Finish**.![Select a file in MySQL Workbench](https://www.inmotionhosting.com/support/wp-content/uploads/2018/10/mysql-workbench-10-select-file.png)   ![Finish in MySQL Workbench](https://www.inmotionhosting.com/support/wp-content/uploads/2018/10/mysql-workbench-12-import-finish.png)
7. At this point, you can **rearrange and connect tables** using the options on the left. ![ERD in MySQL Workbench](https://www.inmotionhosting.com/support/wp-content/uploads/2018/10/mysql-workbench-13-diagram-1024x640.png)
8. Once you’re done editing, you can **export the diagram** as PNG, SVG, PDF, or postscript file. ![Export images in MySQL Workbench](https://www.inmotionhosting.com/support/wp-content/uploads/2018/10/mysql-workbench-14-export-png.png)
9. View the exported image to check results.![Saved ERD in MySQL Workbench](https://www.inmotionhosting.com/support/wp-content/uploads/2018/10/mysql-workbench-15-saved-file-634x1024.png)

To create a diagram for a database directly from cPanel, you’ll need to [connect MySQL Remote Workbench to your server](/support/website/connect-database-remotely-mysql-workbench/) and ensure port 3306 is open.
