How to Fix error "Can't open file:...(errno: 24)" in MySQL

fwh

Administrator
Staff Member
Joined
Dec 8, 2012
Messages
773
Points
63
I tried to view server error log file and found many these errors like this

Code:
160708 22:26:09 [ERROR] /usr/sbin/mysqld: Can't open file: './mydb/file.frm' (errno: 24)
errno: 24 simply means that too many files are open for the given process. There is a read-only mysql variable called open_files_limit that will show how many open files are allowed by the mysqld, you can see this mysql variable by this command.

Code:
SHOW VARIABLES LIKE 'open_files_limit';
MySQL will respond with:

Code:
mysql> SHOW VARIABLES LIKE 'open_files_limit';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| open_files_limit | 1185  |
+------------------+-------+
1 row in set (0.01 sec)
A lot systems set this to something very low, like 1185. If you set the value with this

Code:
SET open_files_limit=48000
Unfortunately it could not work

ERROR 1238 (HY000): Variable 'open_files_limit' is a read only variable
But you can do another way by adding the follow commands into my.cnf file

[mysqld]
open_files_limit = 48000

After that, restart mysql:

Code:
service mysqld restart
Now, SHOW VARIABLES LIKE 'open_files_limit'; should show 65000. The number you use may be different.

Code:
mysql> SHOW VARIABLES LIKE 'open_files_limit';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| open_files_limit | 65535 |
+------------------+-------+
1 row in set (0.00 sec)

Hope that helps!
 
Newer Threads
Similar Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top