Forward Engineering A Database from an ERD Diagram
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.
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 is the Managing Editor of SCM Focus. He is an experienced SAP consultant, sales engineer and sales operations resource. Shaun also performs SAP project advisement and offers free 30 minute phone (and confidential) consultations which can cover any number of SAP questions and answers for implementing companies. Contact me at LinkedIn https://www.linkedin.com/in/shaunsnapp
Latest posts by Shaun Snapp (see all)