DEV Community

Cover image for How to access the ERD (Entity-Relationship Diagram) of your database schema in MySQL Workbench
Massy
Massy

Posted on

50

How to access the ERD (Entity-Relationship Diagram) of your database schema in MySQL Workbench

As a data analysis student, you may know what an Entity Relationship Diagram is and how it helps you quickly get familiar with a database schema and its main properties like tables, table relationships as well as table columns (and their respective data types)

But because you've always been practising and answering the SQL questions using an online interactive SQL instance, you have only been able to view an ERD because it has always been provided to you as an image. This means you've never had to generate a physical entity relationship diagram in a Database Management System like MySQL.

Yet, in the real workplace setting, or when you start answering SQL questions using a DBMS, you need to know how you can view or access the ERD of the database schema you intend to query from.

Below are steps you can follow to view the ERD (Entity-Relationship Diagram) of your database schema in MySQL Workbench:

  1. Open MySQL Workbench and open your database connection.

  2. In the top navigation bar, click on “Database” to expand the list of options.
    Image description

  3. Select “Reverse Engineer” from the database context menu.
    Image description

  4. In the “Reverse Engineer” dialogue box, click “Next” to set parameters for connecting to the Database Management System(DBMS).
    Image description

  5. Enter your password so that MySQL can connect to your DBMS and then click ‘’next’’.
    Image description

  6. Select the database schema for which you want to generate an ERD. And then click ‘’Next’’ again.
    Image description

  7. Enter your password again so that MySQL can retrieve and reverse engineer the schema objects for the schema you chose.
    Image description

  8. Click “Execute” to start the reverse engineering process. This may take a few moments depending on the size of your database.

  9. Click ‘’finish’’ to see the ERD of your database schema displayed in the main window of MySQL Workbench.

In the ERD tab, your ERD may look like this by default :
Image description

The default ERD above may require scrolling back and forth to make sense of its contents. But you can avoid this by customising the ERD layout by dragging the tables and resizing them so that you can see all of them at a glance without the need to scroll down.
Image description

And that’s a wrap!

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 🕒

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (1)

Collapse
 
dana-fullstack-dev profile image
dana • Edited

For reverse engineering i think you can use alternative of this old desktop application. I use Online Database Design for reverse design of my existing database.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay