【MySQL】MySQL之示例数据库Sakila下载及安装
本篇将演示如何下载及安装MySQL示例数据库Sakila。
1、下载Sakila数据库;
[root@strong ~]# wget http://downloads.mysql.com/docs/sakila-db.tar.gz
2、解压;
[root@strong ~]# tar zxvf sakila-db.tar.gz
[root@strong ~]# ll -h sakila-db/
total 3.4M
-rw-r--r--. 1 500 500 3.3M Jul 21 2016 sakila-data.sql --插入语句
-rw-r--r--. 1 500 500 49K Jul 21 2016 sakila.mwb --数据模型
-rw-r--r--. 1 500 500 23K Jul 21 2016 sakila-schema.sql --创建语句
3、安装数据库;
mysql> source ./sakila-db/sakila-schema.sql
mysql> source ./sakila-db/sakila-data.sql
4、检查安装的数据库;
mysql> use sakila
Database changed
mysql> 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 |
+----------------------------+
23 rows in set (0.00 sec)
mysql>
5、查看数据模型;
至此,示例数据库安装完毕。