mysql 连接数配置,解决Too many connections错误

参考:https://developer.aliyun.com/article/824585

查看当前连接数

SHOW full PROCESSLIST;
查看最大连接数配置
show variables like ‘%max_connections%’;

配置

[mysqld]
# 通过修改 MySQL 配置文件调整最大连接数
max_connections = 5266

# 设置超时时间,让mysql自动清理超时的连接
interactive_timeout=500  #超时时间 默认28800秒 (8小时)
wait_timeout=300 #最大睡眠时间  (8小时)

修改后重启 MySQL,使配置文件生效:

sudo systemctl restart mysql

相关推荐

  1. mysql 连接配置解决Too many connections错误

    2024-04-27 23:14:01       28 阅读
  2. tomcat、mysql连接配置

    2024-04-27 23:14:01       50 阅读
  3. Spring Boot配置MySQL数据库连接

    2024-04-27 23:14:01       32 阅读
  4. MySQL 配置连接问题解决方案

    2024-04-27 23:14:01       54 阅读
  5. mysql并发连接设置

    2024-04-27 23:14:01       55 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-27 23:14:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-27 23:14:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-27 23:14:01       87 阅读
  4. Python语言-面向对象

    2024-04-27 23:14:01       96 阅读

热门阅读

  1. 数据结构中的栈和队列(附实际案例代码)

    2024-04-27 23:14:01       26 阅读
  2. 【QT】QPointF、QRectF、QPolygonF 介绍

    2024-04-27 23:14:01       30 阅读
  3. 如何读取一个整行的字符串

    2024-04-27 23:14:01       28 阅读
  4. 顺序排列的二叉树的删除

    2024-04-27 23:14:01       28 阅读
  5. 如何用代码制作一个想要的网站?

    2024-04-27 23:14:01       37 阅读
  6. 状态模式:管理状态转换的策略

    2024-04-27 23:14:01       38 阅读
  7. 请求头headers中的信息

    2024-04-27 23:14:01       35 阅读
  8. SpringBoot的核心内容之自动装配

    2024-04-27 23:14:01       33 阅读