首页 > 其他 > 详细

Too many open files) when using LOCK TABLES

时间:2021-03-08 19:41:45      阅读:33      评论:0      收藏:0      [点我收藏+]
背景: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 -n
1024

3、查看数据库数据目录文件数量

ll /opt/mysql/data/callcenter/|wc -l
7508

二、解决方案

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 |
+------------------+-------+

Too many open files) when using LOCK TABLES

原文:https://blog.51cto.com/ning235/2651127

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!