在使用mysqldump备份数据库的时候出现:
mysqldump: Got error: 1016: Can't open file: './xxx/xxx_893.frm' (errno: 24) when using LOCK TABLES
或其他类似这样的错误,网上有很多文章说加--skip-lock-tables,我尝试了是不行的,看报错信息:errno:24
#perror 24
OS error code 24: Too many open files
一看是这个原因,估计就是系统的open files设置过小
#ulimit -n
1024
mysql>SHOW VARIABLES LIKE '%open_files_limit%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| open_files_limit | 5000 |
+------------------+-------+
修改/etc/security/limits.conf:
echo '
* hard nofile 65535
* soft nofile 65535
' >> /etc/security/limits.conf
重启mysql后再次查询open_files_limit:
mysql>SHOW VARIABLES LIKE '%open_files_limit%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| open_files_limit | 65535|
+------------------+-------+
再运行mysqldump一切正常!
阅读(1034) | 评论(0) | 转发(0) |