当前位置:网站首页> 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 mysql
2、临时修改查看最大连接数:
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内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
- Fiori 应用通过 Adaptation Project 的增强方式分享
- Hardware development notes (9): basic process of hardware development, making a USB to RS232 module (8): create asm1117-3.3v package library and associate principle graphic devices
- 6.30 simulation summary
- Interpretation of hard threshold function [easy to understand]
- 【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告
- 我花上万学带货:3天赚3元,成交靠刷单
- Which securities company has a low, safe and reliable account opening commission
- 逆向调试入门-PE结构-输入表输出表05/07
- Fiori applications are shared through the enhancement of adaptation project
- 木架的场景功能
猜你喜欢
【邂逅Django】——(二)数据库配置
redis探索之缓存击穿、缓存雪崩、缓存穿透
基于.NetCore开发博客项目 StarBlog - (13) 加入友情链接功能
Shell script imports stored procedures into the database
Operator-1 first acquaintance with operator
Function test process in software testing
VS Code 设置单击打开新文件窗口,不覆盖前一个窗口
Project deployment is not difficult at all!
Nc100 converts strings to integers (ATOI)
ROS2 Foxy depthai_ ROS tutorial
随机推荐
【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告
There are risks in trading
System test UI test summary and questions (interview)
Tencent always takes epoll, which is annoying
C language learning
leetcode:329. The longest incremental path in the matrix [DFS + cache + no backtracking + elegance]
基于.NetCore开发博客项目 StarBlog - (13) 加入友情链接功能
【开发大杀器】之Idea
SQLAlchemy在删除有外键约束的记录时,外键约束未起作用,何解?
"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
PG基础篇--逻辑结构管理(触发器)
Zabbix 6.0 源码安装以及 HA 配置
Detailed explanation of OSPF LSA of routing Foundation
[today in history] July 1: the father of time sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world
[brain opening] west tide and going to the world series
MySQL gap lock
【大型电商项目开发】性能压测-压力测试基本概念&JMeter-38
哪个券商公司开户佣金低又安全又可靠
晓看天色暮看云,美图欣赏
声明一个抽象类Vehicle,它包含私有变量numOfWheels和公共函数Vehicle(int)、Horn()、setNumOfWheels(int)和getNumOfWheels()。子类Mot