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

11,073

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.

Share:
11,073

Related videos on Youtube

Deepu
Author by

Deepu

SOreadytohelp

Updated on October 27, 2022

Comments

  • Deepu
    Deepu over 1 year

    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.

  • Deepu
    Deepu over 11 years
    Thanks Jacob, it helps me lot
  • Mike
    Mike about 10 years
    Note, for Debian, the file is located at /etc/mysql/my.cnf and the variable open_files_limit is not there. Just add it below the [mysqld] section.
  • magic_al
    magic_al over 9 years
    Same goes for my Ubuntu 12.04 LTS. File is located in /etc/mysql/my.cnf and open_files_limit isn't there.
  • Andrew Stepanchuk
    Andrew Stepanchuk about 8 years
    adding open_files_limit = 100000 in [mysqld] section had no effect. SHOW VARIABLES LIKE 'open%' still shows 1024
  • Horse
    Horse about 8 years
    @Styopchik you actually have to use open-files-limit=10000 for it to work in the cnf file, note hyphens not underscores