Restrictions on opened file descriptors in MySQL

Source: Internet
Author: User
Can't open file: '. \ test \ mytable. frm' (errno: 24)

Shell> perror 24

OS error code 24: Too enabled open files

If this error occurs, the file descriptor of MySQL is insufficient. The solution is to add operations.

System description symbol:

Set OS parameters (if you have permissions ):

Add the following lines in the/etc/security/limits. conf file:

MySQL soft nofile 65535

MySQL hard nofile 65535

The above configuration is the OS limit on file descriptors that can be opened by individual users, it indicates that mysql users can open 65535 file descriptors (you can use lsof-u MySQL | WC-L to view the number of file descriptors currently opened ).

Step 2: Modify MySQL parameters:

Add the following line in the MySQL configuration file my. CNF.

Open_files_limit = 65535

Innodb_open_files = 65535

Then restart your MySQL instance,

However, it should be noted that my. the number of CnF settings cannot exceed that set in OS. the open_files_limit parameter set in CNF is invalid. That is, after MySQL is started, open_files_limit always takes the OS file descriptor as the standard,

That is, in any case, the file descriptor limit opened by MySQL is the file descriptor limit of OS, and it does not matter with the open_files_limit setting in the configuration file.

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.