ERROR 23 (HY000): Out of resources when opening file ‘/tmp/sometable.MYD’
This happened on a fresh Debian Testing install with only MySQL.
Look up error number:
perror 23 OS error code 23: Too many open files in system
Too many open files.
Check current open files limit for mysql user:
root@debian:/# sudo -u mysql bash mysql@debian:/ ulimit -a | grep open
open files (-n) 1024
Exit mysql’s login:
exit
To set higher limts, add to /etc/security/limits.conf
mysql soft nofile 10000 mysql hard nofile 20000
Increase MySQL open file limit in config:
open_files_limit=20000
Add it to the my.cnf or a local config, e.g.: /etc/mysql/conf.d/local.cnf
This fix worked for me and these pages helped:
http://stackoverflow.com/questions/502545/too-many-open-files-error-on-ubuntu-8-04