MySQL怎么備份指定表中的數據
發表時間:2023-07-20 來源:明輝站整理相關軟件相關文章人氣:
[摘要]這篇文章主要介紹了詳解MySQL導出指定表中的數據的實例的相關資料,希望通過本文能幫助到大家,需要的朋友可以參考下詳解MySQL導出指定表中的數據要求:1. 不導出創表的語句,因為表已經建好:默認會...
這篇文章主要介紹了詳解MySQL導出指定表中的數據的實例的相關資料,希望通過本文能幫助到大家,需要的朋友可以參考下
詳解MySQL導出指定表中的數據
要求:
1. 不導出創表的語句,因為表已經建好:默認會導出,先drop table然后create table;
2. 導出的insert語句加上ignore,允許重復執行:默認不會加上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 數據庫名
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.)
以上就是MySQL如何導出指定表中的數據的詳細內容,更多請關注php中文網其它相關文章!
學習教程快速掌握從入門到精通的SQL知識。