Typically, for a new MySQL server, there is no data for us to test and use. In this respect, MySQL provides us with a number of sample databases, we can base on these databases for basic operations and stress testing and so on. This article describes the installation of the Sakila database. The database needs to be installed in MySQL more than 5.0 version. Here is the description.
1. Download the seed database
Download location: http://dev.mysql.com/doc/index-other.html
2. Install seed database Sakila
Copy Code code 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 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 This can open within MySQL Workbench to examine the database Struc Ture. For more information, the Workbench MySQL.
[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 <sakila-schema.sql
Enter Password:
[Root@localhost sakila-db]# mysql-uroot-p <sakila-data.sql
Enter Password:
3, verify the installation results
Copy Code code 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 |
| Rental |
| Sales_by_film_category |
| Sales_by_store |
| Staff |
| Staff_list |
| Store |
+----------------------------+
Rows in Set (0.00 sec)
Root@localhost[sakila]> Select COUNT (*) from the customer;
+----------+
| COUNT (*) |
+----------+
| 599 |
+----------+
1 row in Set (0.01 sec)