How to troubleshoot files that are not found in MySQL

Source: Internet
Author: User
Tags error code

If you encounter an "ERROR" ... ' Not Found (errno:23) ', "Cannot open the file: ... (errno:24) ", or other error from MySQL with errno 23 or errno 24, which indicates that there are not enough file descriptors assigned to the MySQL server. You can use the Perror utility to understand the meaning of the error number:

Shell> perror 23

Error code 23: File Table Overflow

Shell> Perror 24

Error code 24: Too many open files

Shell> perror 11

Error Code 11: resource is temporarily unavailable

The problem here is that mysqld is trying to open too many files at the same time. You can tell mysqld not to open too many files at once, or to increase the number of mysqld available file descriptors.

To tell Mysqld to control an open file to a smaller number, you can reduce the value of the Table_cache system variable (), thereby reducing the table cache (the default is 64). Lowering the Max_connections value also reduces the number of open files (the default value is 100).

To change the number of file descriptors available for mysqld, you can use the "--open-files-limit" option or setting (starting with MySQL 3.23.30) open_files_limit system variables on Mysqld_safe.

The easiest way to set these values is to add an option to the options file.

If the mysqld version is lower and the number of open files is not supported, you can edit the Mysqld_safe script. There are 1 commented rows Ulimit-n 256 in the script. You can delete the ' # ' character uncomment the line, change the value 256 to set the number of file descriptors available for mysqld.

"--open-files-limit" and ulimit can increase the number of file descriptors, but not the maximum number of operating system limits. There are also 1 "hard" limits that can be overwritten only when you start Mysqld_safe or mysqld as root (remember, in that case, you also need to use the "--user" option to start the server so that it does not continue to run as root after you start). Refer to your system documentation if you need to increase the number of available file descriptors for each process by operating system limits.

Note: If running tcsh shell,ulimit does not work! When the current limit value is requested, TCSH can also notify incorrect values. In this case, you should use SH to start the mysqld_safe.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.