This question already has an answer here:

i want to increase "open files limit mysql" to 2084. what are the commands to run through ssh?

marked as duplicate by David Foerster, Kevin Bowen, TheWanderer, muru, Eric Carvalho Feb 13 '17 at 21:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

To see the current limit, type:

ulimit -a

To check the limit for a particular user (I guess you would be interested in mysql user), type:

su mysql ulimit -a

To increase/modify the limit, do:

vi /etc/security/limits.conf

and add:

mysql hard nofile 2084 
mysql soft nofile 2084

Do the same for /etc/security/limits.d/90-nproc.conf.

You can also temporary increase the open files limit for the user you're currently logged in with:

ulimit -Hn 2084
  • 1
    When systemd is running then OS will be overridden over application parameters inspite of that my.cnf variable couldn't be load for this you can invoke at startup. locate your service file in my case. root@fpe:/apps/fct-core# vim /lib/systemd/system/mysql.service – Mansur Ali Mar 14 at 6:55
  • 1
    When systemd is running then OS will be overridden over application parameters inspite of that my.cnf variable couldn't be load for this you can invoke at startup. locate your service file in my case. root@fpe:/apps/fct-core# vim /lib/systemd/system/mysql.service . add this to your service section LimitNOFILE=infinity – Mansur Ali Mar 14 at 7:17

If you're looking for the MySQL internal limit, it is defined in my.cnf file by the variable open_files_limit = 2084 (see MySQL doc for details).

Depending on your version, the file to edit should be either /etc/mysql/my.cnf or /etc/mysql/mysql.conf.d/mysqld.cnf

Not the answer you're looking for? Browse other questions tagged or ask your own question.