Home  >  Article  >  Database  >  MYSQL Out of resources when opening file './xxx_MySQL

MYSQL Out of resources when opening file './xxx_MySQL

WBOY
WBOYOriginal
2016-06-01 13:06:52920browse

出现Out of resources when opening file './xxx.MYD' (Errcode: 24)错误是因为打开的文件数超过了my.cnf的--open-files-limit。open-files-limit选项无法在mysql命令行直接修改,必须在my.cnf中设定,最大值是65536。

重新启动mysqld,

mysql> show variables like 'open%';

+------------------+-------+

| Variable_name | Value |

+------------------+-------+ |

open_files_limit | 1024 |

+------------------+-------+

如果发现这个变量并没有改变很可能是服务器的打开文件数设定的值limits有问题(用ulimit -n查看)。如果发现是1024,在my.cnf修改为65536后,该值也改成了65536。需要重新登录服务器再重启数据库服务就OK了。这个值会取数据库和服务器设定的最小值。

mysql> show variables like 'open%';

+------------------+-------+

| Variable_name | Value |

+------------------+-------+

| open_files_limit | 65536 |

+------------------+-------+

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn