It is helpful to have a visual representation when designing a database. MySQL Workbench allows you to create entity relationship diagrams (ERDs) with relationships between the tables (one to one, one to many) and rearrange them as needed. Below we cover how to create an ERD from a downloaded SQL file.
3 Answers 3 Sorted by:
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending. 8
You can try File -> Export -> Forward Engineer SQL Create Script. Here you can generate the SQL Script corresponding to your EER diagram, and execute this script in your database engine.
check out this tutorial from the MySQL website,HERE and HERE it shows how to create a connection between Workbench and the server and after that you can forward engineer any tables and such into a database. Hope its what youre looking for.:)
Database > Forward engineer… is a wizard who will guide you to the creation of the database you have modeled.
Thanks for contributing an answer to Stack Overflow!
To learn more, see our tips on writing great answers. Draft saved Draft discarded
The EER Diagram
canvas is where object modeling takes place. To add a table to the canvas, select the Catalog tab in the middle panel on the right side of the application to display any schemas that appear in the MySQL Model tab. Find the sakila
schema and expand the view of its objects by clicking + to the left of the schema name. Expand the tables list in the same way.
Changing the color of a table is a good way to identify a table quickly—something that becomes more important as the number of tables increases. Changing the color of a table is also an easy way to identify a table in the Model Navigator
panel. This panel, the uppermost panel on the left side of the page, gives a birds eye view of the entire EER canvas.
Click the Properties tab of the panel on the lower left and then click one of the tables on the canvas. This action displays the properties of the table in the Properties
window, as the next figure shows. While a table is selected, you can use the Properties
window to change a tables properties. For example, entering #FF0000
for the color value will change the color accent to red.
MySQL Workbench automatically discovers that address.city_id
has been defined as a foreign key referencing the city.city_id
field. Drop the country
table onto the canvas and immediately you should see the relationship between the country
table and the city
table. (To view all the relationships in the sakila
database, see Figure 9.35, “The sakila Database EER Diagram”.)
Create a Diagram from a SQL File
To create a diagram for a database directly from cPanel, you’ll need to connect MySQL Remote Workbench to your server and ensure port 3306 is open.IC
Need help? Ask a question, share a helpful tip, or help others in our community forum.
FAQ
How do I add a table from EER diagram to MySQL Workbench?
How do I open an EER diagram in MySQL Workbench?
- Go to “Database” Menu option.
- Select the “Reverse Engineer” option.
- A wizard will be open and it will generate the ER Diagram for you.
How do I create a database design diagram in MySQL Workbench?
Select File and New Model from the top menu. Select File, hover over Import, and press Reverse Engineer MySQL Create Script…. Specify the SQL file needing a diagram. Press Execute, Next, and then Finish.
How do I create a relational database in MySQL Workbench?