This article describes how to install the sample database Sakila in MySQL. the Sakila database is mainly used for some basic operations and stress testing, for more information, see. Generally, there is no data for testing and using a brand new MySQL server. MySQL provides us with some sample databases for basic operations and stress testing based on these databases. This document describes how to install the sakila database. The database must be installed in MySQL 5.0 or later versions. The following is the description.
1. download the seed database
Download location: http://dev.mysql.com/doc/index-other.html
2. install the seed database sakila
The code is as follows:
[Root @ localhost ~] # 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 including 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. SQL file, along with definitions for triggers that must be created after the initial data load.
The sakila. mwb file is a MySQL Workbench data model that you can open within MySQL Workbench to examine the database structure. For more information, see MySQL Workbench.
[Root @ localhost ~] # Ls
Anaconda-ks.cfg Desktop install. log install. log. syslog sakila-db sakila-db.zip
[Root @ localhost ~] # Cd sakila-db
[Root @ localhost sakila-db] # ls
Sakila-data. SQL sakila. mwb sakila-schema. SQL
[Root @ localhost sakila-db] # mysql-uroot-p Enter password:
[Root @ localhost sakila-db] # mysql-uroot-p Enter password:
3. verify the installation result
The code is as follows:
[Root @ localhost sakila-db] # mysql
Root @ localhost [(none)]> show databases;
+ -------------------- +
| Database |
+ -------------------- +
| Information_schema |
| Mysql |
| Performance_schema |
| Sakila |
| Scottdb |
| Tempdb |
| Test |
+ -------------------- +
7 rows in set (0.01 sec)
Root @ localhost [(none)]> use sakila
Database changed
Root @ localhost [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 |
| Marshal |
| Sales_by_film_category |
| Sales_by_store |
| Staff |
| Staff_list |
| Store |
+ ---------------------------- +
23 rows in set (0.00 sec)
Root @ localhost [sakila]> select count (*) from customer;
+ ---------- +
| Count (*) |
+ ---------- +
| 1, 599 |
+ ---------- +
1 row in set (0.01 sec)