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

孤街浪徒 提交于 2019-12-06 22:54:29

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/11390213/1016-cant-open-file-database-name-sql-38f-36aa-frm-errno-24

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!