mysqldump with WHERE id IN (SELECT …) yields table “was not locked” error

后端 未结 2 1635
我寻月下人不归
我寻月下人不归 2021-02-07 01:03

I have 2 databases, with ~100,000 rows missing from the table field_collection_item from db1, which I\'d like to repair by exporting from db2

2条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 01:28

    If you don't need a consistency guarantee, you can disable locking without single transaction by adding:

    --lock-tables=false

    I use this to do the same thing you're after (dumping subsets of the data) and on replication slaves that I can stop (making it consistent anyway).

    An advantage over --single-transaction is that you can use/mix non-MVCC-engine tables.

提交回复
热议问题