Documentation Home
MySQL Workbench Manual
Related Documentation Download this Manual
PDF (US Ltr) - 14.9Mb
PDF (A4) - 14.9Mb
HTML Download (TGZ) - 13.1Mb
HTML Download (Zip) - 13.2Mb

MySQL Workbench Manual  /  ...  /  Importing a Data Definition SQL Script

9.3.3 Importing a Data Definition SQL Script

For this tutorial, use the sakila database script, which you can find by visiting the page, selecting the Other Docs tab, and looking in the Example Databases section

After downloading the file, extract it to a convenient location. Open MySQL Workbench and find the Reverse Engineer MySQL Create Script menu item by first choosing File and then Import. Find and import the sakila-schema.sql file. This is the script that contains the data definition statements for the sakila database. The file filter for the file open dialog window defaults to *.sql so you should be able to view only files with the sql extension.

If the file was successfully imported, the application's status bar reads, Import MySQL Create Script done. To view the newly imported script, expand the Physical Schemas section by double-clicking the arrow on the left of the Physical Schemas title bar. Select the tab labeled sakila.

You may also wish to remove the default schema tab, mydb. Select this tab, then click - on the upper right in the Physical Schemas panel.

To view all the objects in the sakila schema, you may need to expand the Physical Schemas panel. Move the mouse pointer anywhere over the gray area that defines the lower edge of the Physical Schemas panel. Hold down the right mouse button and move the mouse to adjust the size of the window.

After you have expanded the window, all the objects in the sakila database should be visible. Tables appear at the top followed by views and then routines. There are no routine groups in this schema, but you should see the Routine Groups section and an Add Group icon.

For a complete description of importing a MySQL create script, see Section, “Reverse Engineering Using a Create Script”.

User Comments
  Posted by Rony Bassoul on July 28, 2016
The 'Import - Reverse Engineer MySQL Create Script...' cannot be seen in the Home Tab main menu, it can be found under File in tabs like MySQL Model or EER Diagram only when those are opened.
So in case that Workbench is freshly opened, it can be found under the Models section at the bottom, by clicking on > 'Create EER Model from Script'.
Sign Up Login You must be logged in to post a comment.