open_files_limit:用于指定操作系统允许mysqld打开的最大文件数。只读变量,修改需要重启mysql服务。有几种方式为其指定值。
1. 在命令行中指定open-files-limit值,如下:
/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/vobiledata/mysqldata --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/vobiledata/mysqldata/EQX-605.err --open-files-limit=8192 --pid-file=/tmp/mysqld.pid --socket=/tmp/mysql.sock --port=3306
2. 在参数文件(my.cnf)中指定,如下:
[mysqld_safe]
open-files-limit = 8192
或者
[mysqld]
open-files-limit = 8192
如果mysqld 与 mysqld_safe同时指定open-files-limit 不同的值,则mysqld_safe中的值优先
3.如果没有明确指定open-files-limit的值,则其实际值取下述值的最大者。如果最大值超过操作系统允许值,则实际值为操作系统允许的值。
1) 10 + max_connections + (table_open_cache * 2)
2) max_connections * 5
3) open_files_limit value specified at startup, 5000 if none
1. 在命令行中指定open-files-limit值,如下:
/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/vobiledata/mysqldata --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/vobiledata/mysqldata/EQX-605.err --open-files-limit=8192 --pid-file=/tmp/mysqld.pid --socket=/tmp/mysql.sock --port=3306
2. 在参数文件(my.cnf)中指定,如下:
[mysqld_safe]
open-files-limit = 8192
或者
[mysqld]
open-files-limit = 8192
如果mysqld 与 mysqld_safe同时指定open-files-limit 不同的值,则mysqld_safe中的值优先
3.如果没有明确指定open-files-limit的值,则其实际值取下述值的最大者。如果最大值超过操作系统允许值,则实际值为操作系统允许的值。
1) 10 + max_connections + (table_open_cache * 2)
2) max_connections * 5
3) open_files_limit value specified at startup, 5000 if none