mysql資料庫匯入匯出資料

來源:互聯網
上載者:User

標籤:

匯入資料: 形式:load data infile ‘路徑‘ into table xxx;
outfile:將資訊輸出到檔案上(自動建立檔案,不可以重新檔案,為了保護檔案)
select * from hd_cate;

select * into outfile ‘e:/demo/one‘ from hd_cate;
產生的檔案格式;預設的,採用行來區分記錄,而採用定位字元,來區分欄位
為了滿足某種特別的需求,會採用不同的分割方式,支援,在匯出資料時,設定記錄,與欄位的分隔字元

通過如下的選項
fields:設定欄位選項
Lines;設定行選項(記錄選項)
                     (終止)           (包裹)         (轉義)
先看預設的:fields teminated by ‘\t‘ enclosed by ‘‘ escaped by ‘\\‘
記錄:lines teminated by ‘\n‘ starting by ‘‘
                (終止)           (開始)
可以自己設定  例如:
select * into outfile ‘e:/demo/one‘
fields terminated by ‘,‘
lines terminated by ‘\n‘ starting by ‘start:‘
from hd_cate;

注意:常規是用記錄,行來顯示
但是,儲存位元據
Blob binary
要用into dumpfile(只在檔案末尾加一個檔案結束標誌)
select * into dumpfile ‘e:/demo/one‘ from hd_cate;

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.