set open_files_limit

Did you specify it as open_files_limit or open-files-limit in my.cnf? In config file it should be open-files-limit.


Option 1: You can try running lsof on MySQL’s pid, piped to wc -l.

Option 2: ll /proc/<mysql-pid>/fs/

These will give you the list of open files (including sockets, etc.; everything is a file in Unix/Linux).

The open files limit can be checked on the mysql-client using show global varaibles like '%files%' and then set global variable open_files_limit=<some-larger-number>

Be careful about this, since the number from ulimit -n is a total for the shell for all processes, and you don’t want to put it too high.

If you see this number slowly increasing, you probably want to check your code: there are dangling references.