MySql資料庫匯入匯出

來源:互聯網
上載者:User

標籤:position   指令碼   結構   命令   遠程   資料   個數   資料庫   app   

1、匯出整個資料庫    mysqldump -u 使用者名稱 -p 資料庫名 > 存放位置    比如:    mysqldump -u root -p project > c:/a.sql           (匯出project資料庫已經經過親自測試,成功!) 2.匯出一個表的結構,並且帶表中的資料    mysqldump -u 使用者名稱 -p  資料庫名  表名 > 匯出的檔案名稱    mysqldump -u root -p project  position > c:/a.sql           (測試,成功!) 只匯出表結構,不帶表中的資料:    mysqldump  -d  -u root -p project  position > c:/a.sql           (測試,成功!)  3.匯出一個資料庫結構    mysqldump -u wcnc -p -d --add-drop-table smgp_apps_wcnc >d:wcnc_db.sql    -d 沒有資料 --add-drop-table 在每個create語句之前增加一個drop table 4.匯入資料庫    1、常用source 命令    進入mysql資料庫控制台,        d:/program files/mysql/mysql server 5.1/bin > mysql -u root -p        d:/program files/mysql/mysql server 5.1/bin > mysql>use ‘資料庫‘    然後使用source命令,後面參數為指令檔(如這裡用到的.sql)        d:/program files/mysql/mysql server 5.1/bin > mysql>source d:wcnc_db.sql    2、mysql -uroot -p(密碼) 資料庫名 表名 < 匯入的檔案名稱 5.遠程匯出資料庫命令如下:    mysqldump -h  192.168.11.210  -u  root  -p  test>c:/test.sql

MySql資料庫匯入匯出

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.