欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

MySQL中安裝樣本數(shù)據(jù)庫(kù)Sakila過(guò)程分享

 更新時(shí)間:2014年10月31日 10:50:26   作者:Leshami  
這篇文章主要介紹了MySQL中安裝樣本數(shù)據(jù)庫(kù)Sakila過(guò)程分享,Sakila數(shù)據(jù)庫(kù)主要用來(lái)做一些基本的操作以及壓力測(cè)試等,需要的朋友可以參考下

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

1、下載種子數(shù)據(jù)庫(kù)

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

2、安裝種子數(shù)據(jù)庫(kù)sakila

復(fù)制代碼 代碼如下:

[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、驗(yàn)證安裝結(jié)果

復(fù)制代碼 代碼如下:

[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)

相關(guān)文章

  • 對(duì)比MySQL中int、char以及varchar的性能

    對(duì)比MySQL中int、char以及varchar的性能

    在本篇文章中我們給大家分享了關(guān)于MySQL中int、char以及varchar的性能對(duì)比的相關(guān)內(nèi)容,有興趣的朋友們學(xué)習(xí)下。
    2018-10-10
  • MySQL添加索引及添加字段并建立索引方式

    MySQL添加索引及添加字段并建立索引方式

    這篇文章主要介紹了MySQL添加索引及添加字段并建立索引方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-01-01
  • 解決xmapp啟動(dòng)mysql出現(xiàn)Error: MySQL shutdown unexpectedly.問(wèn)題

    解決xmapp啟動(dòng)mysql出現(xiàn)Error: MySQL shutdown unexpec

    這篇文章主要介紹了解決xmapp啟動(dòng)mysql出現(xiàn)Error: MySQL shutdown unexpectedly.問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-06-06
  • MySQL數(shù)據(jù)庫(kù)如何給表設(shè)置約束詳解

    MySQL數(shù)據(jù)庫(kù)如何給表設(shè)置約束詳解

    約束主要完成對(duì)數(shù)據(jù)的檢驗(yàn),保證數(shù)據(jù)庫(kù)數(shù)據(jù)的完整性;如果有相互依賴(lài)數(shù)據(jù),保證該數(shù)據(jù)不被刪除,本篇文章教你如何給表設(shè)置約束
    2022-03-03
  • 簡(jiǎn)述Redis和MySQL的區(qū)別

    簡(jiǎn)述Redis和MySQL的區(qū)別

    這篇文章主要介紹了簡(jiǎn)述Redis和MySQL的區(qū)別,小編覺(jué)得挺不錯(cuò)的,這里給大家分享下,需要的朋友可以了解。
    2017-10-10
  • MySql多表鏈接查詢(xún)?cè)敿?xì)教程

    MySql多表鏈接查詢(xún)?cè)敿?xì)教程

    這篇文章主要介紹了MySql多表鏈接查詢(xún)?cè)敿?xì)教程的相關(guān)資料,需要的朋友可以參考下
    2022-10-10
  • 你知道哪幾種MYSQL的連接查詢(xún)

    你知道哪幾種MYSQL的連接查詢(xún)

    連接(join)查詢(xún)是將兩個(gè)查詢(xún)的結(jié)果以“橫向?qū)印钡姆绞胶喜⑵饋?lái)的結(jié)果,這篇文章主要給大家介紹了關(guān)于MYSQL連接查詢(xún)的相關(guān)資料,需要的朋友可以參考下
    2021-06-06
  • win10安裝zip版MySQL8.0.19的教程詳解

    win10安裝zip版MySQL8.0.19的教程詳解

    這篇文章主要介紹了win10安裝zip版MySQL8.0.19的教程詳細(xì),本文分步驟給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-02-02
  • mysql使用SQLyog導(dǎo)入csv數(shù)據(jù)不成功的解決方法

    mysql使用SQLyog導(dǎo)入csv數(shù)據(jù)不成功的解決方法

    給mysql導(dǎo)入數(shù)據(jù),選中某個(gè)表選擇導(dǎo)入--導(dǎo)入使用本地csv數(shù)據(jù)即可,單有的時(shí)候不知道什么問(wèn)題導(dǎo)入不成功
    2014-07-07
  • Mysql 實(shí)現(xiàn)向上遞歸查找父節(jié)點(diǎn)并返回樹(shù)結(jié)構(gòu)的示例代碼

    Mysql 實(shí)現(xiàn)向上遞歸查找父節(jié)點(diǎn)并返回樹(shù)結(jié)構(gòu)的示例代碼

    通過(guò)mysql 8.0以下版本實(shí)現(xiàn),一個(gè)人多角色id,一個(gè)角色對(duì)應(yīng)某個(gè)節(jié)點(diǎn)menu_id,根節(jié)點(diǎn)的父節(jié)點(diǎn)存儲(chǔ)為NULL, 向上遞歸查找父節(jié)點(diǎn)并返回樹(shù)結(jié)構(gòu),今天通過(guò)本文給大家介紹Mysql遞歸查找父節(jié)點(diǎn)并返回樹(shù)結(jié)構(gòu),感興趣的朋友一起看看吧
    2022-09-09

最新評(píng)論