Too many open files) when using LOCK TABLES
16lz
2021-03-08
背景:MySQL 数据库执行逻辑备份 mysqldump 出现以下报错:
Can't open file: './callcenter/info.frm' (errno: 24 - Too many open files) when using LOCK TABLES
一、分析问题
1、查看相关变量
mysql> SHOW GLOBAL STATUS LIKE 'open%tables';+---------------+--------+| Variable_name | Value |+---------------+--------+| Open_tables | 1024 || Opened_tables | 564478 |+---------------+--------+2 rows in set (0.00 sec)
2、查看系统最大打开文件数。
[root@localhost callcenter]# ulimit -n1024
3、查看数据库数据目录文件数量
ll /opt/mysql/data/callcenter/|wc -l7508
二、解决方案
4、修改系统最大打开文件数
vi /etc/security/limits.conf* soft nproc 80000* hard nproc 80000* soft nofile 80000* hard nofile 80000
sysctl -p
5、临时修改最大打开文件数
ulimit -n 65535
6、开机加载
vi /etc/rc.local ulimit -n 65535
7、在 my.cnf mysqld添加open_files_limit = 65535
重启mysql服务
8、查看
mysql> SHOW VARIABLES LIKE '%open_files_limit%';+------------------+-------+| Variable_name | Value |+------------------+-------+| open_files_limit | 65535 |+------------------+-------+
©著作权归作者所有:来自51CTO博客作者ning235的原创作品,如需转载,请注明出处,否则将追究法律责任好知识,才能预见未来
赞赏
0人进行了赞赏支持
更多相关文章
- Mac系统上查看端口占用和释放端口教程
- 实现多文件上传案例 以及 MVC与依赖注入的原理
- oracle数据库存储文件结构功能解析
- 安卓布局文件
- 安卓自定义对话框的使用案例
- PHP实战:利用composer写一个MVC小框架
- PHP文件上传实战案例和MVC依赖注入和服务容器
- Composer常用指令以及自动加载器的使用方式
- Linux系统安装和传文件到Linux系统