3 回答

TA貢獻(xiàn)1864條經(jīng)驗(yàn) 獲得超2個(gè)贊
該--lock-tables=false選項(xiàng)是否有效?
根據(jù)手冊(cè)頁(yè),如果要轉(zhuǎn)儲(chǔ)InnoDB表,可以使用以下--single-transaction選項(xiàng):
--lock-tables, -l
Lock all tables before dumping them. The tables are locked with READ
LOCAL to allow concurrent inserts in the case of MyISAM tables. For
transactional tables such as InnoDB and BDB, --single-transaction is
a much better option, because it does not need to lock the tables at
all.
對(duì)于innodb DB:
mysqldump --single-transaction=TRUE -u username -p DB

TA貢獻(xiàn)1883條經(jīng)驗(yàn) 獲得超3個(gè)贊
這已經(jīng)太晚了,但對(duì)搜索主題的任何人都有好處。如果您不是innoDB,并且在轉(zhuǎn)儲(chǔ)時(shí)不擔(dān)心鎖定,只需使用以下選項(xiàng):
--lock-tables=false

TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超4個(gè)贊
答案取決于您使用的存儲(chǔ)引擎。理想的情況是你使用的是InnoDB。在這種情況下,您可以使用該--single-transaction
標(biāo)志,該標(biāo)志將在轉(zhuǎn)儲(chǔ)開始時(shí)為您提供數(shù)據(jù)庫(kù)的連貫快照。
添加回答
舉報(bào)