While running into MySQL’s open files limit will manifest itself into various error messages, this is the standard one that you’ll receive during a mysqldump:
mysqldump: Got error: 29: File './databasename/tablename.MYD' not found (Errcode: 24) when using LOCK TABLES
The best way to get to the bottom of the error is to find out what it means:
$ perror 24
OS error code 24: Too many open files
There’s two ways to fix the problem. First, if you find that you only hit the limit during mysqldumps and never during normal database operation, just add --single-transaction to your mysqldump command line options. This will cause mysql to keep only one table open at a time.
However, if this happens while backups aren’t running, you may want to increase the open_files_limit in your MySQL configuration file. By default, the variable is set to 1,024 open files.
For further reading:
5.2.3. System Variables
7.13. mysqldump – A Database Backup Program
7 Comments on “MySQL: Errcode: 24 when using LOCK TABLES”
You can track this conversation through its atom feed.
Racker Hacker » MySQL: Errcode: 24 when using LOCK TABLES - Web Development Stuff, Freedom Stuff : Appeal-Democrat says:
[...] Racker Hacker » MySQL: Errcode: 24 when using LOCK TABLES [...]
Posted on August 8, 2008 at 6:42 pm.
Thanks it works fine with single transaction
Posted on November 8, 2008 at 7:25 am.
Thanks, this solution save my day.
Posted on May 26, 2009 at 7:39 am.
Thanks mate! This really helped.
Posted on August 14, 2009 at 7:54 am.
thank you so much. it really helps
Posted on September 7, 2009 at 10:34 pm.
Thanks, worked out just fine.
Posted on October 2, 2009 at 2:39 am.
thank you – JEG
Posted on November 25, 2009 at 1:18 pm.