Usually for a brand new MySQL server, there is no data for us to test and use. In this respect, MySQL provides us with some sample databases that we can base on for basic operations, stress testing, and so on. This article describes the installation of the Sakila database. The database needs to be installed in MySQL version 5.0 or more. The following is its description.
1. Download the seed database
Download location:http://dev.mysql.com/doc/index-other.html
2. Install seed database Sakila
[Email protected] ~]# Unzip Sakila-db.zip
Archive:sakila-db.zip
creating:sakila-db/
Inflating:sakila-db/sakila-schema.sql
Inflating:sakila-db/sakila.mwb
Inflating:sakila-db/sakila-data.sql
The Sakila-schema.sql file contains all the Create statements required to create the structure of the Sakila database incl uding tables, views, stored procedures, and triggers.
The Sakila-data.sql file contains the INSERT statements required to populate the structure created by the SAKILA-SCHEMA.SQ L file, along with definitions for triggers that must is created after the initial data load.
The SAKILA.MWB file is a MySQL Workbench data model so can open within MySQL Workbench to examine the database Struc Ture. For more information, see MySQL Workbench.
[[email protected] ~]# ls
Anaconda-ks.cfg Desktop install.log install.log.syslog sakila-db sakila-db.zip
[Email protected] ~]# CD sakila-db
[[email protected] sakila-db]# ls
Sakila-data.sql SAKILA.MWB Sakila-schema.sql
[Email protected] sakila-db]# mysql-uroot-p <sakila-schema.sql
Enter Password:
[Email protected] sakila-db]# mysql-uroot-p <sakila-data.sql
Enter Password:
[[ Email protected] sakila-db]# MySQL
[email protected] [None +--------------------+
| database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sakila |
| scottdb |
| tempdb |
| test |
+--------------------+
7 rows in Set (0.01 sec)
[email protected][(none)]> use Sakila
Database changed
[email protected][Sakila]> Show tables;
+----------------------------+
| Tables_in_sakila |
+----------------------------+
| Actor |
| Actor_info |
| Address |
| Category |
| City |
| Country |
| Customer |
| Customer_list |
| Film |
| Film_actor |
| Film_category |
| Film_list |
| Film_text |
| Inventory |
| language |
| Nicer_but_slower_film_list |
| Payment |
| Rental |
| Sales_by_film_category |
| Sales_by_store |
| Staff |
| Staff_list |
| Store |
+----------------------------+
Rows in Set (0.00 sec)
[email protected][Sakila]> Select COUNT (*) from customer;
+----------+
| COUNT (*) |
+----------+
| 599 |
+----------+
1 row in Set (0.01 sec)
More information: http://dev.mysql.com/doc/sakila/en/sakila-installation.html
Installing the MySQL sample database Sakila