当前位置:网站首页> MySQL报错1040Too many connections的原因以及解决方案
MySQL报错1040Too many connections的原因以及解决方案
2022-07-01 12:59:00 【1024问】
报错原因:
解决办法
总结
MySQL 报错1040 ‘Too many connections’
报错原因:实际连接数超过了mysql 允许的最大连接数,访问量过高,MySQL服务器抗不住。
解决办法1、修改max_connections,如果这个值已经很大,2、这个时候就要考虑增加从服务器分散读压力;
Windows 找到mysql.ini(Linux 修改/etc/my.cnf文件,在[mysqld]中新增max_connections=N)。修改允许最大连接数max_connections=N,默认是100 一般设置到500~1000比较合适(这建立在机器能支撑的情况下,因为如果连接数越多,介于MySQL会为每个连接提供连接缓冲区,就会开销越多的内存,所以要适当调整该值,不能盲目提高设值。),最后重启mysql,一定要重启。

net stop mysqlnet start mysql2、临时修改查看最大连接数:
show variables like ‘%max_connections%';通配符查看当前状态的连接数量,以定夺该值的大小。
show global status like ‘Max_used_connections';修改命令:set global max_connections=1000;(重启mysql服务后会失效)

到此这篇关于MySQL报错1040'Too many connections'的原因以及解决方案的文章就介绍到这了,更多相关MySQL报错1040 Too many connections内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
- 79. 单词搜索【dfs + 回溯visit + 遍历起点】
- Ikvm of toolbox Net project new progress
- Tencent security and KPMG released a regulatory technology white paper to analyze the "3+3" hot application scenarios
- 高薪程序员&面试题精讲系列118之Session共享有哪些方案?
- [encounter Django] - (II) database configuration
- VS Code 设置单击打开新文件窗口,不覆盖前一个窗口
- Zabbix 6.0 源码安装以及 HA 配置
- Topic 2612: the real topic of the 12th provincial competition of the Blue Bridge Cup in 2021 - the least weight (enumerating and finding rules + recursion)
- codeforces -- 4B. Before an Exam
- 软件测试中功能测试流程
猜你喜欢

路由基础之OSPF LSA详细讲解

How can genetic testing help patients fight disease?
![leetcode:241. Design priority for operation expression [DFS + Eval]](/img/d0/8dedeba7ecedccd25e0e3e96ff3362.png)
leetcode:241. Design priority for operation expression [DFS + Eval]

游戏公会在去中心化游戏中的未来

Logstash error: cannot reload pipeline, because the existing pipeline is not reloadable

Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS

VM虚拟机配置动态ip和静态ip访问

Feign & Eureka & zuul & hystrix process
![[brain opening] west tide and going to the world series](/img/b2/444af296e170d19629800b3d4c50fa.jpg)
[brain opening] west tide and going to the world series

图灵奖得主Judea Pearl:最近值得一读的19篇因果推断论文
随机推荐
There are still many things to be done in the second half of the year
Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
How to play with the reading and writing operations of blocking sockets?
nexus搭建npm依赖私库
数字化转型再下一城,数字孪生厂商优锘科技宣布完成超3亿元融资
ROS2 Foxy depthai_ ROS tutorial
Project deployment is not difficult at all!
Different test techniques
localtime居然不可重入,踩坑了
王兴的无限游戏迎来“终极”一战
PG basics -- Logical Structure Management (trigger)
Huawei interview question: Recruitment
Fiori 应用通过 Adaptation Project 的增强方式分享
Interpretation of hard threshold function [easy to understand]
Has anyone ever encountered this situation? When Oracle logminer is synchronized, the value of CLOB field is lost
Class initialization and instantiation
"Analysis of 43 cases of MATLAB neural network": Chapter 40 research on prediction of dynamic neural network time series -- implementation of NARX based on MATLAB
【开发大杀器】之Idea
Development trend and market demand analysis report of China's high purity copper industry Ⓕ 2022 ~ 2028
logstash报错:Cannot reload pipeline, because the existing pipeline is not reloadable