我修改了/etc/mysql/my.cnf
如下
[mysqld]
open-files-limit = 100000
[mysqld_safe]
open-files-limit = 100000
仍然在登录到 mysql 时我没有看到这个变量有任何变化
mysql> SHOW VARIABLES LIKE 'open%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| open_files_limit | 1024 |
+------------------+-------+
1 row in set (0.00 sec)
我首先尝试使用 open_files_limit 但在某处读到我们需要在此变量中将下划线 (_) 替换为破折号 (-)
我正在使用 ubuntu 15.10
有帮助吗?
我也尝试过以下事情
http://duntuk.com/how-raise-ulimit-open-files-and-mysql-openfileslimit
http://serverfault.com/questions/440878/changing-open-files-limit-in-mysql-5-5
--------也对以下文件进行了更改
/etc/mysql/mysql.conf.d/mysqld.cnf
#
query_cache_limit = 1M
query_cache_size = 16M
open-files-limit = 15000
#
最佳答案
如果您通过突触管理器安装 Mysql,那么在最新的 ubuntu 版本 15.10 上,从 my.cnf 文件增加 open_file_limit 将不起作用。您需要进行以下更改。
1. Open /lib/systemd/system/mysql.service as super user
2. Add the following lines to the end of it:
LimitNOFILE=infinity
LimitMEMLOCK=infinity
3. Execute sudo systemctl daemon-reload
4. Restart mysql.
关于mysql - 无法增加 MySql 打开文件限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35111698/