Installing the MySQL sample database Sakila

Source: Internet
Author: User
Tags mysql version

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.