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
相关文章
- 06-18accept4: too many open files; retrying in 1s
- 06-18[Go] gin 解决: accept4: too many open files
- 06-18iOS错误 - too many open files (error = 24)
- 06-18【MySQL故障处理】[ERROR] Failed to open log (file '/data/mysql_3306/logs/mysql_bin.000012', errn
- 06-18关于mina框架EMFILE: open too many files exception的处理
- 06-18xtrabackup备份MySQL报错:InnoDB: Error number 24 means 'Too many open files'
- 06-18[ERROR] Error in accept: Too many open files故障处理
- 06-18nginx访问报错:Too many open files accept:
- 06-18InnoDB: Error number 24 means ‘Too many open files’.--转载