mysql - Too many open files error on Ubuntu 8.04 -


mysqldump: Field show 'could not be executed' from 'tablename`:' / databasename / tablename # P # out of resources when opening file ' P125.MYD '(Error code: 24) (23)

On error 24, it says on

  & quot; 24 24 Error code: Too many open files  

How do I solve it? Firstly, to identify the limitations of some users or groups, you have to do the following:

root @ Ubuntu: ~ # sudo -u mysql bash Mysql @ubuntu: ~ $ ulimit -a Core file size (Block, -C) 0 data size size (kbytes, -d) Unlimited scheduling priority (-e) 0 file size (block, -f) unlimited pending signals (-i)) 71680 Maximum lock memory (kbytes, -l) 32 Maximum memory size (kbytes, -m) Unlimited open files (-n) 1024 pipe Size (512 bytes, p) 8 POSIX messages Qatar (Bytes, -K) 819200 Real Time Priority (-R) 0 Stack size (kbite, -s) 8,192 CPU time (seconds, -T) Unlimited maximum user processes (-us) 71680 virtual memory (kbites, -v) The unlimited file lock (-x) unlimited mysql @ Ubuntu: ~ $

is the important line:

Open files (-n) 1024

As you can see, your operating system vendor ships this version with the original Linux configuration Confirms - 1024 files per process.

This is clearly a busy MySQL installation

Now, to fix this, you must modify the following file:

/etc/security/limits.conf

  mysql soft nofile 24000 mysql hard nofile 32000  

Some flavors of Linux require additional configuration to stick to the daemon process vs log sessions. In Ubuntu 10.04, for example, you need to set the range of PAM sessions by adding the following line to /etc/pam.d/common-session :

  Session requires: pam_limits.so  

Comments