詳解MySQL導(dǎo)出指定表中的數(shù)據(jù)
要求:
1. 不導(dǎo)出創(chuàng)表的語句,因為表已經(jīng)建好:默認會導(dǎo)出,先drop table然后create table;
2. 導(dǎo)出的insert語句加上ignore,允許重復(fù)執(zhí)行:默認不會加上ignore;
3. insert語句中列出表中的字段,看得更清楚:默認不會;
4. 分記錄生成多條insert語句,修改起來比較容易:默認是一條;
最終結(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ū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
標(biāo)簽:溫州 防疫工作 固原 廣西 浙江 內(nèi)江 汕尾 撫順
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《詳解MySQL導(dǎo)出指定表中的數(shù)據(jù)的實例》,本文關(guān)鍵詞 詳解,MySQL,導(dǎo)出,指定,表,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。