Khorne
Khorne

Reputation: 63

Cannot set open-file-limit above 1024 on Mysql 5.5

I'm using Centos 7 and Mysql 5.5 (MariaDB).

I want to increase the value of open-file-limit which is currently to 1024.

I have added the line "open_files_limit=24000" and "open-files-limit=24000" (because some people are stating that there is a bug with this variable and _ )in the [mysqld] section in /etc/my.cnf.d/server.cnf

In /etc/security/limits.conf I added these two lines : * hard nofile 64000 * soft nofile 32000

Then restarted MySQL. But Mysql continue to report a value of 1024 for open_files_limit.


ulimit -Hn correctly report 64000 and ulimit -Sn correctly report 32000

But now I'm lost, I don't know what I need to do more to increase this variable. If someone has the answer.... Thank you

UPDATE

On another server with Centos 6 and MySQL 5.1, I have no problem to increase this variable

Upvotes: 1

Views: 2052

Answers (2)

jking
jking

Reputation: 1

check open_files_limit=24000 is in [mysqld]

Upvotes: 0

Khorne
Khorne

Reputation: 63

For people that might have the same problem, here is the solution:

Create a file limits.conf in "/etc/systemd/system/mariadb.service.d"

In limits.conf, put:

[Service]
LimitNOFILE=24000

Then, use these commands:

systemctl daemon-reload

systemctl restart mariadb.service

Upvotes: 2

Related Questions