詳解MySQL導(dǎo)出指定表中的數(shù)據(jù)的實例
詳解MySQL導(dǎo)出指定表中的數(shù)據(jù)
要求:
1. 不導(dǎo)出創(chuàng)表的語句,因為表已經(jīng)建好:默認(rèn)會導(dǎo)出,先drop table然后create table;
2. 導(dǎo)出的insert語句加上ignore,允許重復(fù)執(zhí)行:默認(rèn)不會加上ignore;
3. insert語句中列出表中的字段,看得更清楚:默認(rèn)不會;
4. 分記錄生成多條insert語句,修改起來比較容易:默認(rèn)是一條;
最終結(jié)果如下:
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.)
如有疑問請留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
- mysql mysqldump只導(dǎo)出表結(jié)構(gòu)或只導(dǎo)出數(shù)據(jù)的實現(xiàn)方法
- mysql 導(dǎo)入導(dǎo)出數(shù)據(jù)庫、數(shù)據(jù)表的方法
- 一次非法關(guān)機導(dǎo)致mysql數(shù)據(jù)表損壞的實例解決
- 詳解 linux mysqldump 導(dǎo)出數(shù)據(jù)庫、數(shù)據(jù)、表結(jié)構(gòu)
- mysql不同數(shù)據(jù)庫不同數(shù)據(jù)表導(dǎo)入數(shù)據(jù)
- 由于mysql運行權(quán)限導(dǎo)致無法找到 Discuz! 論壇數(shù)據(jù)表! 的解決方法
- MySQL刪除表數(shù)據(jù)的方法
- MySQL實現(xiàn)兩張表數(shù)據(jù)的同步
- Mysql 根據(jù)一個表數(shù)據(jù)更新另一個表的某些字段(sql語句)
- MySQL多表數(shù)據(jù)記錄查詢詳解
- MySQL 表數(shù)據(jù)的導(dǎo)入導(dǎo)出操作示例
相關(guān)文章
mysql8.0及以上my.cnf設(shè)置lower_case_table_names=1無法啟動問題
這篇文章主要介紹了mysql8.0及以上my.cnf設(shè)置lower_case_table_names=1無法啟動問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2023-11-11
mysql5.7.13 環(huán)境搭建教程(解壓縮版)
這篇文章主要為大家詳細(xì)介紹了mysql解壓縮版環(huán)境搭建教程,具有一定的實用性,感興趣的小伙伴們可以參考一下2016-07-07
MySQL基礎(chǔ)學(xué)習(xí)之字符集的應(yīng)用
這篇文章主要為大家詳細(xì)介紹了MySQL中字符集的相關(guān)使用,例如字符集的查詢與修改和比較規(guī)則等,文中的示例代碼講解詳細(xì),需要的可以參考一下2023-05-05

