I want to dump data from my table by certain criteria, here is the sql query:
"SELECT * FROM document WHERE date BETWEEN 20160101 AND 20160131"
Table that I am selecting from is MyISAM Merge.
I have deleted rows that are matching that query, and I want to import them back from backup, but only those rows.
I have tried making dump like this:
mysql -uroot -proot mydb -e "SELECT * INTO OUTFILE '/tmp/doc.sql' from document WHERE date BETWEEN 20160101 AND 20160131".
But it will generate a file that can not be imported by phpmyadmin import tool. And yet again PMA does not want to do any export of this query result.
Any help ? I can not post structure of the real database/table because of NDA.
EDIT: for all that are having trouble dumping data from MyISAM MRG table, you need to dump from the subtable, not the main one.