[root@test ~]# /root/tcyang/tbs.sh
ERROR 23 (HY000) at line 1: Out of resources when opening file '/tmp/tbs.log' (Errcode: 24 "Too many open files")
[root@test ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 256618
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 256618
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@test ~]#
[root@test ~]# ulimit -n 65535
You have new mail in /var/spool/mail/root
[root@test ~]#
[root@test ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 256618
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65535
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 256618
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@test ~]#
修改open files和max user processes 值:
[root@yoon export]# ulimit -n 65535
[root@yoon export]# ulimit -u 65535
修改完open files和max user processes 值后,重启mysql数据库,然后再还原数据库即可
在mysql配置文件 my.cnf 中 找到 open_files_limit
增加它的值就行了
我的原来是 open_files_limit = 600
后来给修改成 open_files_limit = 1024
就OK了,如果还不行的话,就慢慢加大这个数值