How do I install the Sakila database into MySQL Workbench on a Mac?

user10202850 picture user10202850 · Aug 9, 2018 · Viewed 9.4k times · Source

How would I go about installing the Sakila database onto my Mac?

Importing Data and Schema to MySQL Workbench

I've used the comment by user dr01 in this post, but I'm not sure if I'm ready to use it or not. The Sakila file I downloaded has 3 files (sakila-data.sql, sakila-schema.sql,sakila.mwb) but I only used the schema file while importing it into Workbench. Thanks.

Answer

Mike Lischke picture Mike Lischke · Aug 10, 2018

Pretty simple: the Sakila DB is so small you can just run the 2 SQL files in Workbench:

  • Download the sakila dump from https://dev.mysql.com/doc/index-other.html.
  • Open a connection to your server in MySQL Workbench, where you want to load Sakila.
  • In the SQL editor toolbar there's a button to load a file. Click that and select sakila-schema.sql.
  • Once loaded you just execute the full editor content. This is for the DB structure.
  • Now load the content by opening the sakila-data.sql script. Again, execute the entire editor.

Now refresh the schema tree by clicking on the small refresh icon

enter image description here

and you should see the Sakila schema in the tree. That's it.