I run a nightly mysqldump of all my databases and one of them has over 500 tables, mysqldumper bring me a error while processing this huge database:
My Error message:
1 | mysqldump: Got error: 1016: Can't open file: './dbname/tablename.frm' (errno: 24) when using LOCK TABLES |
I found two different solutions to avoid this nasty problem.
Solution one:
This solution will cause mysql to keep only one table open at a time.
Little example of the mysqldump command:
1 | mysqldump --single-transaction --user=root --password=root database >database.sql |
Solution two:
The second solution is a little bit dirty, it will skip all locked tables.
Append –skip-lock-tables option to your mysqldump operations, this will look like this one:
1 | mysqldump --skip-lock-tables --user=root --password=root database >database.sql |
Thomas says
Hi,
the option “–single-transaction” should only be used with InnoDB tables and implies “lock-tables=false”. So handle with care. And RTFM:
http://www.manpagez.com/man/1/mysqldump/
Bye