mysql - 无法增加 MySql 打开文件限制

标签 mysql ubuntu ubuntu-14.04

我修改了/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/

相关文章:

php - 如何插入多行,每行都有一个数组?

PHP - 启用错误堆栈跟踪

Python 2.7 无法导入 PyQt4

python-2.7 - 无法在 ubuntu 14.04 上将 matplotlib 升级到 1.4.3

linux - 安装 ubuntu 14.04 时 Windows 8 数据丢失

php - 在 php 中使用存储过程

MySQL 事务返回错误

php - 用巨大的数组填充表

ubuntu - Mercurial 森林扩展 : not found

linux - 使用命名管道将一个 shell 脚本的输出作为另一个输入