国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

MySQL中安裝樣本數據庫Sakila過程分享

2024-07-24 13:06:27
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了MySQL中安裝樣本數據庫Sakila過程分享,Sakila數據庫主要用來做一些基本的操作以及壓力測試等,需要的朋友可以參考下
 
 

通常情況下對于一個全新的MySQL服務器,沒有任何數據供我們測試和使用。對此,MySQL為我們提供了一些樣本數據庫,我們可以基于這些數據庫作基本的操作以及壓力測試等等。本文描述的是安裝sakila數據庫。該數據庫需要安裝在MySQL 5.0以上的版本。以下是其描述。

1、下載種子數據庫

下載位置:http://dev.mysql.com/doc/index-other.html

2、安裝種子數據庫sakila

 

復制代碼代碼如下:

[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 <sakila-schema.sql
Enter password:
[root@localhost sakila-db]# mysql -uroot -p <sakila-data.sql
Enter password:

 

3、驗證安裝結果

 

復制代碼代碼如下:

[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                      |
+----------------------------+
23 rows in set (0.00 sec)
root@localhost[sakila]> select count(*) from customer;
+----------+
| count(*) |
+----------+
|      599 |
+----------+
1 row in set (0.01 sec)

 

 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 霍城县| 广灵县| 延寿县| 南靖县| 百色市| 什邡市| 建水县| 和平县| 江西省| 阿克| 文登市| 宕昌县| 大悟县| 平山县| 康定县| 当阳市| 象山县| 天峨县| 内丘县| 咸阳市| 木里| 汾西县| 九江市| 昔阳县| 东安县| 荣成市| 威远县| 灵寿县| 奉节县| 左权县| 左云县| 攀枝花市| 永年县| 晋中市| 赞皇县| 长顺县| 珠海市| 上杭县| 林周县| 通辽市| 托克托县|