sakila資料的使用學習記錄,sakila資料記錄

來源:互聯網
上載者:User

sakila資料的使用學習記錄,sakila資料記錄
sakila資料庫匯入

  • 下載好sakila資料庫,看到裡面會有sakila-data.sql資料檔案和sakila-schema模式檔案
  • 在資料庫上建立一個空的資料庫create database sakila;
  • use sakila 並使用source 命令
    • 先匯入模式檔案source e:/sqldata/sakila-db/sakila-schema.sql;
    • 再匯入資料檔案source e:/sqldata/sakila-db/sakila-data.sql;
  • select count(*) from custormer;顯示幾百條記錄就說明匯入成功了
sql檔案的匯入匯出

1.匯出sql指令碼
mysqldump -u 使用者名稱 -p 資料庫名 > 存放位置
mysqldump -u root -p test > c:/a.sql

2.匯入sql指令碼
mysql -u 使用者名稱 -p 資料庫名 < 存放位置
mysqljump -u root -p test < c:/a.sql
注意,test資料庫必須已經存在
MySQL匯出匯入命令的用例

3.匯出一個資料庫結構
mysqldump -u wcnc -p -d –add-drop-table smgp_apps_wcnc >d:wcnc_db.sql
-d 沒有資料 –add-drop-table 在每個create語句之前增加一個drop table

相關文章

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.