Forward Engineering A Database from an ERD Diagram

by Shaun Snapp on September 14, 2010

Flexibility

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 Lynda.com 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.


Conclusion

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.

 

Shaun Snapp

Shaun Snapp is a long time supply chain planning software consultant, author & as well as the Managing Editor at SCM Focus. He focuses on both SAP APO as well as best of breed applications for demand, supply and production planning.

Latest posts by Shaun Snapp (see all)

{ 2 comments… read them below or add one }

Tom Coyes November 3, 2011 at 5:09 pm

Hi Shawn:
I just got started with Mysql & workbench and would much appreciate it if you could clarify for me this forward engineering notion. What’s the purpose of forward engineer db in mysql?
As an exercise I have created a schema with tables, relationship, some procedures and triggers, entered, modified, deleted records in the various tables, all this in workbench. So, why would I want or need to forward engineer a database? Thanks in advance.

Shaun Snapp November 3, 2011 at 6:51 pm

Hi Tom,

This basically just means that you design the database in an ERD form before you set up the database physically. This is just to have it documented and to make sure that the design you select makes sense and it scalable. Once in an ERD form you can discuss it with others you can provide input.

Previous post:

Next post: