[MySQL]mysqldump匯出及mysql匯入操作
發表於 : 2009年 3月 2日, 16:17
匯出整個 db的方式可以參考這篇: http://bbs.diary.tw/viewtopic.php?t=374
若是要匯出單個 table 的方式, 利用 mysqldump 指定 table 就可以進行操作, 如下:
而要匯入時, 使用 mysql 指令, 如下:
由於 mysqldump 預設就會加入 if exists table 就 drop 的指令, 所以在匯入時, 不想先刪除 table , 要特別注意.
若是要匯出單個 table 的方式, 利用 mysqldump 指定 table 就可以進行操作, 如下:
代碼: 選擇全部
mysqldump databasename -u username -p table1 table2 > test.sql
代碼: 選擇全部
mysql databasename -u username -p < test.sql