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

