MySQL 5.1 リファレンスマニュアル :: B Errors, Error Codes, and Common Problems :: B.1 Problems and Common Errors :: B.1.2 Common Errors When Using MySQL Programs :: B.1.2.17 'File' Not Found and Similar Errors
« B.1.2.16 Can't initialize character set

B.1.3 Installation-Related Issues »
Section Navigation      [Toggle]
  • B.1.2 Common Errors When Using MySQL Programs
  • B.1.2.1 Access denied
  • B.1.2.2 Can't connect to [local] MySQL server
  • B.1.2.3 Client does not support authentication protocol
  • B.1.2.4 Password Fails When Entered Interactively
  • B.1.2.5 Host 'host_name' is blocked
  • B.1.2.6 Too many connections
  • B.1.2.7 Out of memory
  • B.1.2.8 MySQL server has gone away
  • B.1.2.9 Packet too large
  • B.1.2.10 Communication Errors and Aborted Connections
  • B.1.2.11 The table is full
  • B.1.2.12 Can't create/write to file
  • B.1.2.13 Commands out of sync
  • B.1.2.14 Ignoring user
  • B.1.2.15 Table 'tbl_name' doesn't exist
  • B.1.2.16 Can't initialize character set
  • B.1.2.17 'File' Not Found and Similar Errors

B.1.2.17. 'File' Not Found and Similar Errors

If you get ERROR '...' not found (errno: 23), Can't open file: ... (errno: 24), or any other error with errno 23 or errno 24 from MySQL, it means that you haven't allocated enough file descriptors for the MySQL server. You can use the perror utility to get a description of what the error number means:

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 temporarily unavailable

The problem here is that mysqld is trying to keep open too many files simultaneously. You can either tell mysqld not to open so many files at once or increase the number of file descriptors available to mysqld.

To tell mysqld to keep open fewer files at a time, you can make the table cache smaller by reducing the value of the table_open_cache system variable (the default value is 64). Reducing the value of max_connections also reduces the number of open files (the default value is 100).

To change the number of file descriptors available to mysqld, you can use the --open-files-limit option to mysqld_safe or (as of MySQL 3.23.30) set the open_files_limit system variable. See 項4.2.3. 「システム変数」. The easiest way to set these values is to add an option to your option file. See 項3.3.2. 「オプションファイルの使用」. If you have an old version of mysqld that doesn't support setting the open files limit, you can edit the mysqld_safe script. There is a commented-out line ulimit -n 256 in the script. You can remove the ‘#’ character to uncomment this line, and change the number 256 to set the number of file descriptors to be made available to mysqld.

--open-files-limit and ulimit can increase the number of file descriptors, but only up to the limit imposed by the operating system. There is also a 「hard」 limit that can be overridden only if you start mysqld_safe or mysqld as root (just remember that you also need to start the server with the --user option in this case so that it does not continue to run as root after it starts up). If you need to increase the operating system limit on the number of file descriptors available to each process, consult the documentation for your system.

Note: If you run the tcsh shell, ulimit does not work! tcsh also reports incorrect values when you ask for the current limits. In this case, you should start mysqld_safe using sh.

Copyright © 1997, 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices
Top / Previous / Next / Up / Table of Contents
© 2010, Oracle Corporation and/or its affiliates