S
S
Sekira2014-11-08 20:35:03
MySQL
Sekira, 2014-11-08 20:35:03

How to dump part of a table with a subquery without locking MyISAM tables?

When running the command:

mysqldump --lock-tables=false --quick --opt 'db' table1 table2 --where="id in (select id from table2 where field1=123)"

There is an error Table 'table2' was not locked with LOCK TABLES (1100), although the table1 dump is being created and seems to be correct, but as I understand it, the error occurs because mysqldump wants to dump table2 again, but I don't need it (more precisely, I need , but it is done by a separate command and everything is fine with it, since it is without a subquery).
How can I make mysqldump not dump table2 from a subquery, or is it easier to do > /dev/null 2>&1 ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2017-01-23
@aliasst

https://jsfiddle.net/L6vtdgsx/1/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question