Out of resources for mysqldump
Solution 1:
According to here - "OS error code 24: Too many open files" which lines up with the more general error 23 "Out of resources".
So it seems as though you are running out of file handles. This is usually server-end setting/problem, either in MySQL, or in the OS itself.
Perhaps check/adjust the --open-files-limit
setting in MySQL itself and see if that helps.
Also, perhaps try running the dump, while no one else is using the DB, with the --single-transaction
setting instead of --Lock-File
, as several people suggest this will work one table at a time instead of opening them all at once (therefore using less file handles).
Beyond that you'll probably have to find a root cause as to why this particular server is running out of resources. Which would probably involve troubleshooting by disabling as many services/processes as possible and see if the dump goes through. Then figure out from there who the culprit is that's eating too many resources and perhaps not freeing them correctly.
Solution 2:
Are you in a position to try it with --single-transaction
instead of --lock-tables
e.g. the tables are InnoDB and you are not using Cluster tables and that ALTER TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE won't happen during the dump? Best confirm this is ok with your MySQL support org if you have one.
I've only tried this on unix but basically if I try with a DB with 2000 tables it fails with error similar to yours e.g. I've used all my open file handles.
Solution 3:
You may get this error:
MySQL: Errcode: 24 when using LOCK TABLES
...along with other errors when you upgrade to MySQL 5.5 and you are running your backups on Plesk or any other OS executing mysqldump
.
To fix:
- Edit
my.cnf
Add:
open_files_limit=2048
Restart MySQL
If you are receiving:
Cannot load from mysql.proc. The table is probably corrupted (1548)
This is a result of an upgrade to 5.5. Execute:
mysql_upgrade --force
Tested and worked on CentOS 6.7 and Plesk 12.