Forward Engineering A Database from an ERD Diagram

What This Article Covers

  • Flexibility of MySQL
  • Performing the Activity in MySQL Workbench


One interesting issue is that when creating a database it can be easier to bring into MySQL Workbench in order to create an ERD diagram first, and then convert this ERD into a schema. I don’t know why this is the case, but I was having a problem using the SQL script from a sample database that I downloaded from the training website.

Performing the Activity

The way to do this is simple, although not inherently obvious from the MySQL Workbench interface.

First, create an ERD diagram by simply selecting Create EER Model from SQL Script” from the main introductory screen and the Data Modeling area in the middle.

Be careful to select the file encoding that the SQL script is maintained in.

It will provide this window.

This will then create the ERD diagram.

Now the next step is forward engineering the database. This can be done by selecting the following menu path.

This will bring up this options screen.

Now we will want to export the MySQL table objects.

This then shows the scripts that will be executed.

Now you tell it where you want it exported.

The schema or database has now been created.


This has been a good exercise to demonstrate how there are multiple ways to do the same thing in MySQL Workbench. Generally, the Mac version of MySQL Workbench seems significantly easier to work with and smoother than the PC version.