Mysql Installation Sample database Sakila process sharing _mysql

Source: Internet
Author: User

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)

Related Article

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.