Out of resources when opening file ‘./xxx.MYD’ (Errcode: 24)解决方法

凉白开 MySQLOut of resources when opening file ‘./xxx.MYD’ (Errcode: 24)解决方法已关闭评论13,881字数 784阅读2分36秒阅读模式

今天朋友向我反映网站出现错误:Out of resources when opening file './xxx.MYD' (Errcode: 24)错误是因为打开的文件数超过了my.cnf的--open-files-limit。open-files-limit选项无法在mysql命令行 直接修改,必须在my.cnf中设定. 如果你要是不设置的话,他会取系统ulimit -n的值.

出错之时,参数配置如下:文章源自运维生存时间-https://www.ttlsa.com/mysql/out-of-resources-when-opening-file-errcode-24/

mysql> show variables like 'open%';
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| open_files_limit | 1024  |
+------------------+-------+
1 row in set (0.00 sec)

修改open file的值,ulimit -n 204800. 或者在/etc/profile的最后一样加上ulimit -u 204800 -HSn 204800. 执行 source /etc/profile,最后重启一下数据库。文章源自运维生存时间-https://www.ttlsa.com/mysql/out-of-resources-when-opening-file-errcode-24/

# service mysql restart

查看目前的情况佮.文章源自运维生存时间-https://www.ttlsa.com/mysql/out-of-resources-when-opening-file-errcode-24/

mysql> show variables like 'open%';
+------------------+--------+
| Variable_name    | Value  |
+------------------+--------+
| open_files_limit | 204800 |
+------------------+--------+
1 row in set (0.00 sec)

配置数据库的时候千万不要忘记设置这个了。文章源自运维生存时间-https://www.ttlsa.com/mysql/out-of-resources-when-opening-file-errcode-24/

转载请注明来自运维生存时间:https://www.ttlsa.com/html/3393.html文章源自运维生存时间-https://www.ttlsa.com/mysql/out-of-resources-when-opening-file-errcode-24/ 文章源自运维生存时间-https://www.ttlsa.com/mysql/out-of-resources-when-opening-file-errcode-24/

weinxin
我的微信
微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~
凉白开
  • 本文由 发表于 12/10/2013 15:44:43
  • 转载请务必保留本文链接:https://www.ttlsa.com/mysql/out-of-resources-when-opening-file-errcode-24/
  • Errcode: 24
  • mysql
  • opening file
  • Out of resources when opening file