Back to all posts

MySQL ER Diagram and Design Tool for MySQL Workbench Users

How DbSchema draws an existing MySQL database as an ER diagram, keeps the design offline and turns it into a model for any database.

On this page
Words in this article

Words in this article

ER diagram
A picture of a database: each table is a box, and each link between two tables is a line.
Reverse-engineering
Reading the tables and keys of a live database and drawing them.
Foreign key
A column that points to a row in another table.
Model
A tool's own copy of the schema, saved as a file.
Virtual foreign key
A link that lives only in the DbSchema model and never changes the database.
Forward engineering
Writing SQL from a model.
Logical design
A description of the data that names no database: entities, attributes and relations.
Version control
A system such as Git that keeps every version of a file and who changed what.

The short answer

You want a MySQL ERD, an ER diagram of your MySQL database, or a MySQL Workbench alternative to keep designing the model you drew there. An ER diagram shows each table as a box and each link between two tables as a line. DbSchema draws it from the live database, lets you change the design offline, and carries it to MySQL or another database:

  1. Diagram an existing MySQL database

    DbSchema connects and draws every table and foreign key.

  2. Keep designing without a connection

    DbSchema Pro saves the design as a file, with Git built in, and writes the SQL for each change.

  3. Carry the design to another database

    DbSchema Architect turns it into a logical design for MySQL or PostgreSQL.

What DbSchema adds to a MySQL ER diagram

Why DbSchema

See the steps ↓

DbSchema is a desktop design tool for Windows, macOS and Linux. It connects to MySQL and more than 100 other databases.

  • The diagram from your live database

    DbSchema reads the tables and their links from MySQL and draws them (Connect to Database).

  • The design in Git, with merges

    DbSchema Pro saves the design in one .dbs file. File → Git Collaboration commits and pulls it (Git Collaboration).

  • Changes as reviewed SQL

    Pro compares the saved design with the database and writes the SQL for the differences you pick (Schema Synchronization).

  • One design for MySQL and PostgreSQL

    DbSchema Architect keeps a logical design and generates the model for the database you choose (Logical Design).

Then, in DbSchema:Reverse-engineerDesign offlineCompareRedesign

Key takeaways

  • Reverse-engineering only reads from MySQL, so the diagram shows what really runs.
  • Virtual foreign keys add the links your application uses but the database never declared.
  • When two people change the same design, DbSchema shows both versions side by side to merge.
  • A Workbench 8.0 model moves into DbSchema as an SQL script.

What users say

DbSchema data modelling capability is more than enough for most companies. … DbSchema is a very useful tool.

Vincent Rainardi · Data Warehousing and Data Science blog, October 2023

I mainly use the ER diagram, schema visualization, and database synchronization tools because they make database management faster and easier.

G2 reviewer, 10/10 recommendation · G2

Reverse-engineer a MySQL database into an ERD

Reverse-engineering means reading the tables and keys of a live database and drawing them. DbSchema connects to the database, so the MySQL schema diagram shows what really runs. The badges show the edition each step needs.

  1. Connect to MySQL Community

    Choose File → New Model and keep Connect to Database selected. Click MySQL, choose New Connection, and press Connect to MySQL. Fill in the host, port, user and password, then press Connect. DbSchema downloads the JDBC driver itself. A JDBC driver is the small program a Java application uses to talk to a database.

    01 JDBC driverDbSchema downloads the MySQL JDBC driver itself. You don't install anything.

    02 Where MySQL runsThis computer uses localhost and the default port. Pick the other option for a server or a custom port.

    The DbSchema connection dialog for MySQL: connection name MySql, the mysql-connector-j JDBC driver, This computer default port, database user root, a hidden password and the database taskapp

    03 User and passwordA MySQL user and its password. Remember keeps the password for the next connection.

    04 Test ConnectionChecks host, user and password before you connect.

    Figure 1. The MySQL connection dialog. DbSchema picked the MySQL JDBC driver itself; you fill in host, user, password and, optionally, the database. Click the screenshot to enlarge it.
  2. Reverse-engineer the schema Community

    In Reverse Engineer the Database, tick the schemas and press Import. A schema is one database on the MySQL server, with its tables. DbSchema draws the tables and their foreign keys. A foreign key is a column that points to a row in another table, such as orders.customer_id. Connecting and importing only read from the database.

    01 System schemasinformation_schema, mysql, performance_schema and sys belong to MySQL itself. Leave them unticked.

    DbSchema lists the schemas of a MySQL 8 server: information_schema, mysql, performance_schema and sys unticked, the application schema taskapp ticked with its tables, views, procedures, functions and triggers

    02 Your schemaTick it to import its tables, views, procedures, functions and triggers.

    Figure 2. Choosing what to reverse-engineer from MySQL 8. Tick your own schema, here taskapp, and leave the system schemas out. Click the screenshot to enlarge it.
  3. Add the links the database doesn't declare Community

    Some tables are joined in the application but have no foreign key. Drag the child column, the one that points, onto the parent column, the one it points to. Then tick Virtual. A virtual foreign key lives only in the DbSchema model and never changes the database (Foreign Keys).

    01 Referenced tableThe parent table, here orders in the shop schema.

    02 VirtualTicked, the key lives only in the DbSchema model. The database doesn't change.

    The New Foreign Key dialog in DbSchema with Virtual ticked: shipments.order_id refers to orders.order_id

    03 ColumnsReferring Column is the child column, shipments.order_id. Referred Column is the one it points to, orders.order_id.

    Figure 3. A virtual foreign key from shipments.order_id to orders.order_id. The Virtual tick keeps it in the model only. Click the screenshot to enlarge it.

A large schema reads best as several small diagrams. Diagram → New Diagram adds one to the same model, and Auto Arrange Tables lays out the tables by their foreign keys (Diagrams). The MySQL ER diagram guide explains the line ends.

Design offline, without a live database connection

While you're connected, every change you confirm runs in the database at once. DbSchema Pro lets you work on the design instead, and decide later what reaches the database.

  1. Save the design as a file Pro

    Choose File → Save Model to File. The design is now a .dbs file, DbSchema's own copy of the schema, called the model.

  2. Go offline and change the design Pro

    Choose Database → Offline (connect later). Add columns, tables and foreign keys on the diagram. Your changes stay in the model, and the database doesn't change.

  3. Share it in Git Pro

    Choose File → Git Collaboration, tick the .dbs file and commit it. Git is a version control system: it keeps every version of a file and who changed what. When two people change the same part, DbSchema shows both versions side by side to merge them.

    01 The model fileTick the .dbs model file to include it in the commit.

    02 DiffShows what changed in the model file.

    The DbSchema Git Collaboration panel: one uncommitted change, the model file shop.dbs ticked, the commit message Add the shop model and a Commit button

    03 Commit messageSay what changed, such as Add the shop model.

    04 CommitSaves the version on this computer. Push sends it to the shared repository.

    Figure 4. Git Collaboration inside DbSchema: tick the .dbs file, write a message, commit. Push sends it to the shared repository. Click the screenshot to enlarge it.
  4. Compare and apply Pro

    Connect again and choose Compare. DbSchema lists each difference between the model and the database, with its SQL, and runs only the changes you pick (Schema Synchronization).

    01 One row per differenceThree differences: one goes to the model, two to the database.

    02 Pick the side that winsCreate adds birth_date to the database. Drop removes it from the model. Ignore skips it.

    The DbSchema Synchronize Model and Database dialog: three differences, a new column birth_date, a renamed column and a table suppliers, each with Create, Rename, Drop or Ignore, and the ALTER TABLE statement that would run

    03 Generate SQL scriptWrites the changes as a script you review first, instead of running them.

    04 The SQL that runsThe ALTER TABLE statement this choice runs in the database.

    Figure 5. Compare lists each difference and the SQL it would run. Shown on a PostgreSQL demo model; with MySQL the dialog is the same. Click the screenshot to enlarge it.

01 SaveSaves the design as a .dbs model file, the same as File → Save Model to File.

02 OfflineNo MySQL connection is open. Your changes stay in the model until you compare and apply them.

A MySQL design model of a task app in DbSchema 10.5.2, offline: nine tables such as teams, users, tasks, projects and task_comments, arranged by their foreign keys

03 task_commentsAdd columns, tables and foreign keys right on the diagram. Each line is a foreign key.

04 tasksEach table is a box with its columns. The key icon marks the primary key, the arrow icons the foreign keys.

Figure 6. A MySQL design model in DbSchema, offline: nine tables of a task app, arranged by their foreign keys. Click the screenshot to enlarge it.
Workbench 8.0 model, a .mwb zip archive that does not merge in Git, targeting MySQL; DbSchema model, a .dbs file with Git built in in Pro, for MySQL, PostgreSQL, MongoDB and more, and a logical design in Architect
Figure 7The DbSchema model is one file with Git built in, for MySQL and every other supported database.

File → Export As... → HTML5/PDF Documentation, also in Pro, turns the same model into documentation for readers without a database login.

Move your MySQL Workbench model to DbSchema

Oracle now lists MySQL Workbench 8.0 as no longer maintained. Its successor, Workbench 26, names no data modeling on its product page, checked on 19 November 2026. A .mwb model from Workbench 8.0 still moves into DbSchema in two steps.

Two paths into a DbSchema model: from a live MySQL database by reverse-engineering in Community, and from a Workbench .mwb model through an SQL script imported in Pro
Figure 8A live database comes in through reverse-engineering. A Workbench model comes in as an SQL script.

In Workbench 8.0, open the model and choose File → Export → Forward Engineer SQL CREATE Script. Forward engineering means writing SQL from a model. The result is a text file of CREATE TABLE statements.

In DbSchema, choose File → Import Model from SQL or Data Files. Pick the file, set DBMS, the database type, to MySQL, and press Load Model. DbSchema reads the statements into a new model without running them. This import needs DbSchema Pro (Import and Export the Model). If the tables already exist in a database, reverse-engineer that database instead.

01 FilesPick this for the SQL script you exported from Workbench.

02 ChooseOpens the file picker. Select the .sql file.

The DbSchema Load Model dialog: read from Files, choose the SQL file, read as Detect automatically, put the result in a new model and choose the DBMS

03 DBMSSet it to MySQL, the dialect Workbench wrote the script in.

04 Load ModelReads the script into a new model. Nothing runs against a database.

Figure 9. Load Model reads the Workbench SQL script into a new model. Choose the file, set DBMS to MySQL, press Load Model. Nothing runs in a database. Click the screenshot to enlarge it.

Logical design with DbSchema Architect

Many teams now run PostgreSQL next to MySQL. DbSchema Architect adds logical design, so one design serves both.

A physical model holds the tables of one database, with its data types. A logical design describes the same data without choosing a database. It uses entities, attributes and relations instead of tables, columns and foreign keys.

DbSchema Architect works in both directions. Model → Convert Model with Target DBMS set to LogicalDesign turns your reverse-engineered MySQL model into a logical design. Model → Generate Physical Model then creates the model for the database you choose, such as PostgreSQL. The logical design stays as it is, so you can generate MySQL again later.

01 Target DBMSLogicalDesign turns the MySQL model into a logical design.

The DbSchema Convert Model dialog with Target DBMS set to LogicalDesign
Figure 10. Model → Convert Model with Target DBMS LogicalDesign. Click the screenshot to enlarge it.

01 Target DBMSThe database to generate the model for, here PostgreSQL. Pick MySQL to get the MySQL model back.

The DbSchema Generate Physical Model dialog with Target DBMS PostgreSQL and Inheritance Model SingleTable

02 Inheritance ModelHow subtypes become tables. SingleTable keeps them in one table.

Figure 11. Model → Generate Physical Model, here for PostgreSQL. Pick MySQL to generate the MySQL model again. Click the screenshot to enlarge it.

02 EntitiesA logical design lists entities instead of tables.

01 ConvertTurns the design into a physical model for the database you choose.

A logical design in DbSchema: the entities countries, addresses, customers, orders, payments, shipments and others, with attribute names written with spaces and dashed relation lines

03 customersAn entity with its attributes. Names use plain words, such as first name.

Figure 12. A logical design in DbSchema Architect. Attribute names use plain words, such as customer id. Click the screenshot to enlarge it.

A new design can also start here. File → New Model → Design without Database → Logical Design opens an empty logical model, before any table exists. Check triggers and procedures after you generate a physical model. They are code stored in the database, written in the language of one database.

The MySQL Workbench alternatives article covers teams that run several databases. For Oracle, see the Oracle ER diagram and data modeling guide.

DbSchema Architect is the right edition if you design before the database exists or plan one model for MySQL and PostgreSQL. It also shows which procedures read and write a table. It includes everything in Pro. DbSchema Pro fits developers who keep the MySQL design in a file, work on it offline and send changes as scripts they review. Viewing the diagram stays free in the Community Edition. The pricing page lists every edition.

Download DbSchema and try all features free for 15 days, without registration. To design across databases, choose DbSchema Architect.

Sources

  1. MySQL, Workbench 26.7.0 and 26.10.0 release notes (dev.mysql.com/doc/relnotes/workbench), read 19 November 2026.
  2. MySQL, Workbench product page (mysql.com/products/workbench), read 19 November 2026.
  3. MySQL Workbench 8.0 Reference Manual, Forward Engineering Using an SQL Script (dev.mysql.com/doc/workbench), read 19 November 2026.
  4. DbSchema, Connect to Database, Diagrams, Foreign Keys, Git Collaboration and Schema Synchronization documentation.
  5. DbSchema, Import and Export the Model, Logical Design and Licensing documentation.
  6. DbSchema, purchase page, read 19 November 2026.

Draw your MySQL schema as a diagram

DbSchema reverse-engineers the MySQL database you open in Workbench into an interactive ER diagram. DbSchema Architect turns the design into a model for MySQL, PostgreSQL or another database.