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.
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.
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.
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.
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”.)
1 Answer 1 Sorted by:
Try: File->Export->Forward Engineer SQL CREATE Script
Thanks for contributing an answer to Stack Overflow!
To learn more, see our tips on writing great answers. Draft saved Draft discarded
FAQ
How do I export a database from MySQL Workbench to SQL?
How do I create a database diagram in MySQL Workbench?
- Select the schema to export in the Tables to export.
- Click on Export to Self-Contained file.
- Check if Advanced Options… are exactly as you want the export.
- Click the button Start Export.
How do I get SQL script from MySQL Workbench?