Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

#1016 - Can't open file: './database_name/#sql-38f_36aa.frm' (errno: 24)

I have table in mysql with MyISAM storage engine. I want to create partition on a particular table, for this I am executing the query -

alter table Stops PARTITION BY KEY(`stop_id`) PARTITIONS 200

Where 'stop_id' is type of varchar. While executing the above query I am getting the error -

#1016 - Can't open file: './database_name/#sql-38f_36aa.frm' (errno: 24)

Can anybody please help me to resolve this problem?

Thank You.

like image 542
Deepu Avatar asked Jul 09 '12 06:07

Deepu


1 Answers

From here and here.

errno: 24 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:

SHOW VARIABLES LIKE 'open%';

A lot systems set this to something very low, like 1024. Unfortunately, the following will NOT work:

SET open_files_limit=100000

MySQL will respond with:

ERROR 1238 (HY000): Variable 'open_files_limit' is a read only variable

However, it is possible to make a change to /etc/my.cnf. This file may not exist, if not, just create it. Be sure it has the following contents:

[mysqld]

open-files-limit = 100000

Then, be sure to restart mysql:

sudo /etc/init.d/mysql restart

Now, SHOW VARIABLES LIKE 'open%' should show 100000. The number you use may be different.

like image 147
Jacob Avatar answered Sep 25 '22 23:09

Jacob