mysql - max_connections 选项不适用于 mysqld

标签 mysql file connection-pooling

我已经设置max_connections=2000/etc/my.conf并重新启动mysqld

但仍然max_connections似乎被困在 412

mysql>  SHOW VARIABLES LIKE "max_connections";
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 412  |
+-----------------+-------+
1 row in set (0.01 sec)

mysql>

我也尝试过重新启动mysqld发布

mysql> SET GLOBAL max_connections = 2000;

但我仍然得到 max_connections | 412来自查询SHOW VARIABLES LIKE "max_connections";

最佳答案

  1. 为服务文件创建覆盖

    systemctl编辑mysql.service

  2. 添加以下内容

    [Service]
    LimitNOFILE=4096
  • 重新启动 MySQL 服务器

    重启mysql服务

  • 关于mysql - max_connections 选项不适用于 mysqld,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49108056/

    相关文章:

    php - 合并sql表中重叠的日期间隔

    php - 如何用php将文件内容转换为字节数组

    java - 在单个套接字上发送和接收多个请求和响应(多线程)

    java - PoolingHttpClientConnectionManager 与 PoolingNHttpClientConnectionManager

    java - 指定 GenericKeyed Pool 的构造函数 Arg ( Apache Commons )

    mysql - 使用 Magmi 导入 Magento 产品 - 访问数据库被拒绝

    当一条记录插入表中时,MySql 自动更新第二个表

    MySQL SELECT 按组最频繁

    java - 在 Linux 上的 Scala 中锁定和写入文件的最佳方式

    c# - 文件被两个进程使用