[ERROR] Error in accept: Too many open files故障处理

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用系列 2核4GB
简介: mysql无法连接数据库,连root账号都无法连接进去。查看错误日志发现有很多错误:[ERROR] Error in accept: Too many open files。 查看global参数open_files_limit=1024,但是my.cnf里面open_files_limit = 65535 , 查看操作系统的ulimit -n也是1024,因此断定是mysql打开文件数过多超出限制导致。
mysql无法连接数据库,连root账号都无法连接进去。查看错误日志发现有很多错误:[ERROR] Error in accept: Too many open files。
查看global参数open_files_limit=1024,但是my.cnf里面open_files_limit = 65535 ,
查看操作系统的ulimit -n也是1024,因此断定是mysql打开文件数过多超出限制导致。

解决办法:
ulimit -SHn 65536
 vi /etc/security/limits.conf
添加
mysql soft nofile 65535
mysql hard nofile 65535
再重启mysql,查看 global参数 open_files_limit,已经是65535了。


参考文档:
http://blog.sina.com.cn/s/blog_4a071ed80100st7z.html
http://www.linuxqq.net/archives/555.html
相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
26天前
|
iOS开发 Perl
解決pod install报错:unable to access: LibreSSL SSL_read: error:Operation timed out, errno 60
解決pod install报错:unable to access: LibreSSL SSL_read: error:Operation timed out, errno 60
45 0
|
12月前
|
缓存 Windows
【cmd报错:Error :could not open】
【cmd报错:Error :could not open】
202 0
|
JavaScript
Error: EMFILE: too many open files, watch 报错的解决方法
Error: EMFILE: too many open files, watch 报错的解决方法
655 1
|
Ubuntu
解决办法:GLib-ERROR **: Creating pipes for GWakeup: Too many open files
解决办法:GLib-ERROR **: Creating pipes for GWakeup: Too many open files
158 0
|
Linux API PHP
php遇到failed to open stream: Permission denied
php遇到failed to open stream: Permission denied
711 0
|
缓存 开发工具 git
Git报错Error:RPC failed; curl 18 transfer closed with outstanding read data remaining
Git报错Error:RPC failed; curl 18 transfer closed with outstanding read data remaining
423 0
|
数据库 索引
rpmdb open failed 的解决办法
今天用yum安装软件竟然报错: 错误:rpmdb: BDB0113 Thread/process 18550/140359256418112 failed: BDB1507 Thread died in Berkeley DB library 错误:db5 错误(-30973) 来自 ...
1621 0