今天朋友向我反映网站出现错误: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/

评论