日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > 数据库 >内容正文

数据库

dump mysql database_【MySQL Database】数据迁移工具:mysqldump

發(fā)布時(shí)間:2025/4/16 数据库 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 dump mysql database_【MySQL Database】数据迁移工具:mysqldump 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

[mysql@wallet01 ~]$ mysqldump --help

-u, --user=name 指定連接數(shù)據(jù)庫(kù)服務(wù)器使用的用戶

-p, --password 指定連接數(shù)據(jù)庫(kù)服務(wù)器使用的密碼

-P, --port=# 指定連接數(shù)據(jù)庫(kù)服務(wù)器使用的端口

-h, --host=name 指定連接數(shù)據(jù)庫(kù)服務(wù)器的主機(jī)名

-A, --all-databases 備份全部的數(shù)據(jù)庫(kù)

-B, --databases 備份指定的數(shù)據(jù)庫(kù)

-t, --no-create-info 僅備份表記錄

-d, --no-data 僅備份表結(jié)構(gòu)

-w, --where=name 僅備份表中匹配條件的記錄

-E, --events 備份數(shù)據(jù)庫(kù)的事件

-R, --routines 備份數(shù)據(jù)庫(kù)的存儲(chǔ)過程與函數(shù)

--triggers 備份表的觸發(fā)器

-x, --lock-all-tables 鎖定全部數(shù)據(jù)庫(kù)中的全部表。

-T, --tab=nameCreate tab-separated textfile for each table to given path. (Create .sql and .txt files.)

--fields-terminated-by=nameFields in the output file are terminated by the given string.

--fields-enclosed-by=nameFields in the output file are enclosed by the given character.

--lines-terminated-by=nameLines in the output file are terminated by the given string.

--dump-slave[=#] This causes the binary log position and filename of the

master to be appended to the dumped data output. Setting

the value to 1, will printit as a CHANGE MASTER command

in the dumped data output; if equal to 2, that command

will be prefixed with a comment symbol. This option will

turn --lock-all-tables on, unless --single-transaction is

specified too (in which case a global read lock is only

taken a short time at the beginning of the dump - don't

forget to read about --single-transaction below). In all

cases any action on logs will happen at the exact moment

of the dump.Option automatically turns --lock-tables off.

--master-data[=#] This causes the binary log position and filename to be

appended to the output. If equal to 1, will print it as a

CHANGE MASTER command; if equal to 2, that command will

be prefixed with a comment symbol. This option will turn

--lock-all-tables on, unless --single-transaction is

specified too (in which case a global read lock is only

taken a short time at the beginning of the dump; don't

forget to read about --single-transaction below). In all

cases, any action on logs will happen at the exact moment

of the dump. Option automatically turns --lock-tables

off.

--single-transaction

Creates a consistent snapshot by dumping all tables in a

single transaction. Works ONLY for tables stored in

storage engines which support multiversioning (currently

only InnoDB does); the dump is NOT guaranteed to be

consistent for other storage engines. While a

--single-transaction dump is in process, to ensure a

valid dump file (correct table contents and binary log

position), no other connection should use the following

statements: ALTER TABLE, DROP TABLE, RENAME TABLE,

TRUNCATE TABLE, as consistent snapshot is not isolated

from them. Option automatically turns off --lock-tables.

備份指定的庫(kù)

[mysql@wallet01 ~]$ mysqldump -uroot -p --databases soe > soe.sql

備份指定的表

[mysql@wallet01 ~]$ mysqldump -uroot -p soe customer >customer.sql

僅備份表結(jié)構(gòu)

[mysql@wallet01 ~]$ mysqldump -uroot -p --no-data soe customer >customer.sql

僅備份表記錄

[mysql@wallet01 ~]$ mysqldump -uroot -p --no-create-info soe customer >customer.sql

僅備份表中匹配條件的記錄

[mysql@wallet01 ~]$ mysqldump -uroot -p --where="c_state='z3'" soe customer >customer.sql

還原指定的庫(kù)

[mysql@wallet01 ~]$ mysql -uroot -p soe < soe.sql

還原指定的表

[mysql@wallet01 ~]$ mysql -uroot -p soe < customer.sql

表結(jié)構(gòu)備份為sql文件,表記錄備份為文本文件

[mysql@wallet01 ~]$ mysqldump -uroot -p --tab=/var/lib/mysql-files \

--fields-terminated-by=',' --fields-enclosed-by='"' --lines-terminated-by='\n' soe customer

[mysql@wallet01 ~]$ cd /var/lib/mysql-files

[mysql@wallet01 mysql-files]$ ls -lh

total 165M

-rw-rw-r-- 1 mysql mysql 2.5K Sep 18 10:08 customer.sql

-rw-rw-rw- 1 mysql mysql 165M Sep 18 10:08 customer.txt

還原表結(jié)構(gòu)

[mysql@wallet01 ~]$ mysql -uroot -p soe < customer.sql

還原表記錄

[mysql@wallet01 ~]$ mysqlimport -uroot -p soe \

--fields-terminated-by=',' \

--fields-enclosed-by='"' \

--lines-terminated-by='\n' /var/lib/mysql-files/customer.txt

Enter password:

soe.customer: Records: 300000 Deleted: 0 Skipped: 0 Warnings: 0

《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀

總結(jié)

以上是生活随笔為你收集整理的dump mysql database_【MySQL Database】数据迁移工具:mysqldump的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 中文字幕超清在线免费观看 | 日韩av大片在线观看 | 亚洲精品国产成人 | 99精品视频在线 | 日韩有码av| 色老板最新地址 | 男女午夜啪啪 | 爱情岛成人 | 欧美日韩乱 | 国产精品51麻豆cm传媒 | 久久久久久久久久久久Av | 成人免费性生活视频 | 亚洲九九热 | 夜夜操操操| 少妇搡bbbb搡bbb搡小说 | 亚洲男人的天堂在线视频 | 日韩欧美性视频 | 性猛交xxxx| 人人99| 欧美男优 | 亚洲福利在线播放 | 中文字幕免费在线看线人 | www.久热 | 在线只有精品 | 久久精品成人av | 国产三级视频在线 | 国产精品久久久久毛片软件 | 饥渴放荡受np公车奶牛 | 小色瓷导航 | 欧美日韩1区2区3区 亚洲日本精品视频 | 成人国产一区 | 色噜噜狠狠成人中文 | 伊人网在线观看 | 看av在线| 男人午夜av| 久久大胆视频 | 女性高潮视频 | 爽妇网国产精品 | 国产精品一色哟哟哟 | 女女h百合无遮涩涩漫画软件 | 射精一区二区 | 国产又黄又粗又猛又爽 | 水蜜桃久久 | h色视频在线观看 | 久久久久久久中文字幕 | 日本高清黄色 | 国产高清在线精品 | 波多野结衣一本一道 | juliaann欧美二区三区 | 影音av资源| 久久影视中文字幕 | 亚洲 高清 成人 动漫 | 国内福利视频 | 成人综合婷婷国产精品久久 | 熟女人妻一区二区三区免费看 | 俺来也俺也啪www色 欧洲一区二区视频 | 已满18岁免费观看电视连续剧 | 国产97超碰 | 少妇性高潮视频 | 中文资源在线播放 | 激情久久免费视频 | 五月婷婷网| www.97av.com| 中国黄色片子 | 精品国产麻豆 | 亚洲AV无码久久精品色三人行 | 日韩中文字幕一区二区三区四区 | 欧美精品成人一区二区三区四区 | 日本在线观看www | 日产精品久久久 | 午夜视频网 | 香蕉网在线 | 91久久精品国产91久久 | 大象传媒成人在线观看 | 黄色片网站在线免费观看 | 麻豆午夜| 亚洲天堂欧美 | 夜夜操操操 | 青青草.com| 日本欧美中文字幕 | 国产三级理论 | 深夜天堂 | 污免费在线观看 | 伊人精品视频在线观看 | 老头巨大又粗又长xxxxx | 啪啪免费 | 黄色综合| 欧美性生交xxxxx久久久 | 深夜av| 毛片av在线| 天天爱av| 91精品久久久久久久久 | 寂寞少妇让水电工爽hd | 亚洲日本在线观看 | www,色 | 中文字幕在线资源 | 色婷婷激情av | 亚洲精品日韩在线 | 91精品国产综合久久福利 |