3 回答

TA貢獻1864條經(jīng)驗 獲得超2個贊
該--lock-tables=false選項是否有效?
根據(jù)手冊頁,如果要轉(zhuǎn)儲InnoDB表,可以使用以下--single-transaction選項:
--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.
對于innodb DB:
mysqldump --single-transaction=TRUE -u username -p DB

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

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