Mysql Error: too many open files

# error: ERROR 1018 (HY000): Can’t read dir of ‘.’ (errno: 24)

# Super user
$ sudo su

# See what mysql files are open
$ lsof -u mysql

# Count how many mysql files are open
$ lsof -u mysql | wc -l

# close mysql files
$ kill -9 `lsof -t -u mysql`

# sources
http://i-learnings.blogspot.com.br/2012/11/error-1018-hy000-cant-read-dir-of-errno.html
http://www.webhostingtalk.com/showthread.php?t=1138305