這篇文章主要介紹了詳解mysql導出指定表中的數(shù)據(jù)的實例的相關資料,希望通過本文能幫助到大家,需要的朋友可以參考下
詳解mysql導出指定表中的數(shù)據(jù)
要求:
1. 不導出創(chuàng)表的語句,因為表已經(jīng)建好:默認會導出,先drop table然后create table;
2. 導出的insert語句加上ignore,允許重復執(zhí)行:默認不會加上ignore;
3. insert語句中列出表中的字段,看得更清楚:默認不會;
4. 分記錄生成多條insert語句,修改起來比較容易:默認是一條;?
最終結果如下:
mysqldump?-pxxxxxx?qzt?qf1_mail_account?--no-create-info?--insert-ignore?--complete-insert?--skip-extended-insert?>qf1_mail_account.sql
其中:
-pxxxxxx 指定密碼
qzt 數(shù)據(jù)庫名
qf1_mail_account 表名
>qf1_mail_account.sql 保存到文件?
mysqldump –help 寫道
?-t,?--no-create-info? ???????????Don't?write?table?creation?info. ?--insert-ignore???Insert?rows?with?INSERT?IGNORE. ?-c,?--complete-insert? ???????????Use?complete?insert?statements. ?-e,?--extended-insert? ???????????Use?multiple-row?INSERT?syntax?that?include?several ???????????VALUES?lists. ???????????(Defaults?to?on;?use?--skip-extended-insert?to?disable.)
? 版權聲明
文章版權歸作者所有,未經(jīng)允許請勿轉載。
THE END