mysql資料庫從windows遷移到linux,或者linux遷移到windows教程

來源:互聯網
上載者:User

一、匯出.sql檔案,開啟DOS命令列,cd進入mysql的bin目錄,執行

mysqldump -uroot -p您的密碼 資料庫名 >D:/匯出檔案名稱.sql
如:

mysqldump -uroot -p123456 listener >D:/listener.sql

二、到入到linux的mysql裡

先將listener.sql上傳到系統根目錄或者其他目錄

執行

mysql –uroot –p123456 -Dtest<d:\test\ss.sql

我本人是直接先進入mysql,選中資料庫,use listener,然後執行的

source /listener.sql

然後完成了(listener.sql我放在linux根目錄,所以用/)

Query OK, 0 rows affected (0.00 sec)Query OK, 2 rows affected (0.01 sec)Records: 2  Duplicates: 0  Warnings: 0Query OK, 0 rows affected (0.00 sec)Query OK, 1 row affected (0.00 sec)Query OK, 24 rows affected (0.01 sec)Records: 24  Duplicates: 0  Warnings: 0

同理,將mysql資料從linux遷移到windows也是一樣的操作,舉一反三哦


相關文章

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.