Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to increase MySql open-files-limit

I have modified /etc/mysql/my.cnf as follows

[mysqld]
open-files-limit = 100000
[mysqld_safe]
open-files-limit = 100000

Still when login to mysql I am not seeing any change in this variable

mysql> SHOW VARIABLES LIKE 'open%';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| open_files_limit | 1024  |
+------------------+-------+
1 row in set (0.00 sec)

I have first tried using open_files_limit but read somewhere that we need to replace underscore(_) with dash(-) in this variable

I am using ubuntu 15.10 Any help?


I have tried following things too

http://duntuk.com/how-raise-ulimit-open-files-and-mysql-openfileslimit
http://serverfault.com/questions/440878/changing-open-files-limit-in-mysql-5-5

-------Also made change to following file

/etc/mysql/mysql.conf.d/mysqld.cnf

#
query_cache_limit   = 1M
query_cache_size        = 16M
open-files-limit    = 15000
#
like image 553
Ashwini Avatar asked Jan 31 '16 08:01

Ashwini


1 Answers

If you are installing Mysql through synaptic manager then on latest ubuntu version 15.10 increasing open_file_limit from my.cnf file will not work. You need to do following changes.

1. Open /lib/systemd/system/mysql.service as super user
2. Add the following lines to the end of it:

LimitNOFILE=infinity
LimitMEMLOCK=infinity

3. Execute sudo systemctl daemon-reload

4. Restart mysql.
like image 123
Ashwini Avatar answered Nov 15 '22 07:11

Ashwini