mySQL Error 1040: Too Many Connection(mySQL 错误 1040:连接过多)
问题描述
如何解决这些问题,SQL 错误 1040:连接过多"即使我试着把
How to fix these, "SQL Error 1040: Too Many Connection" even I try to put
max_user_connection=500
仍然是连接过多"
推荐答案
MySQL: ERROR 1040: Too many connections
这基本上说明 MySQL 同时处理最大连接数,默认情况下它同时处理 100 个连接.
This basically tells that MySQL handles the maximum number of connections simultaneously and by default it handles 100 connections simultaneously.
以下原因导致 MySQL 连接耗尽.
These following reasons cause MySQL to run out connections.
慢查询
数据存储技术
错误的 MySQL 配置
Bad MySQL configuration
通过执行以下操作,我能够克服这个问题.
I was able to overcome this issues by doing the followings.
打开MySQL命令行工具
并输入,
show variables like "max_connections";
这将返回给你这样的东西.
This will return you something like this.
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 100 |
+-----------------+-------+
您可以将设置更改为例如200 通过发出以下命令而无需重新启动 MySQL 服务器.
You can change the setting to e.g. 200 by issuing the following command without having to restart the MySQL server.
set global max_connections = 200;
现在当您下次重新启动 MySQL 时,它将使用此设置而不是默认设置.
Now when you restart MySQL the next time it will use this setting instead of the default.
请记住,连接数的增加会增加 MySQL 运行所需的 RAM 量.
这篇关于mySQL 错误 1040:连接过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:mySQL 错误 1040:连接过多


- SQL 临时表问题 2022-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01