当前位置:网站首页> 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内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
- 科学创业三问:关于时机、痛点与重要决策
- Redis exploration: cache breakdown, cache avalanche, cache penetration
- VM virtual machine configuration dynamic IP and static IP access
- Shell script imports stored procedures into the database
- What are the solutions for session sharing of highly paid programmers & interview questions series 118?
- 6.30 simulation summary
- [Niu Ke's questions -sql big factory interview real questions] no2 User growth scenario (a certain degree of information flow)
- Quickly understand what the compressed list in redis is
- 快速整明白Redis中的压缩列表到底是个啥
- How to count the status of network sockets?
猜你喜欢

leetcode:241. 为运算表达式设计优先级【dfs + eval】

ROS2 Foxy depthai_ ROS tutorial

Function test process in software testing

Feign & Eureka & zuul & hystrix process

Different test techniques

Redis explores cache consistency

"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

Share several tools for designing exquisite circuit diagrams

【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告

The popular major I chose became "Tiankeng" four years later
随机推荐
6.30 simulation summary
[encounter Django] - (II) database configuration
Feign & Eureka & zuul & hystrix process
逆向调试入门-PE结构-输入表输出表05/07
R语言基于h2o包构建二分类模型:使用h2o.gbm构建梯度提升机模型GBM、使用h2o.auc计算模型的AUC值
Vs code setting Click to open a new file window without overwriting the previous window
Question d'entrevue de Huawei: recrutement
How to count the status of network sockets?
运行Powershell脚本提示“因为在此系统上禁止运行脚本”解决办法
VM virtual machine configuration dynamic IP and static IP access
be based on. NETCORE development blog project starblog - (13) add friendship link function
【邂逅Django】——(二)数据库配置
Zero copy technology of MySQL
Operator-1初识Operator
快速整明白Redis中的压缩列表到底是个啥
Tencent security and KPMG released a regulatory technology white paper to analyze the "3+3" hot application scenarios
基于开源流批一体数据同步引擎 ChunJun 数据还原 —DDL 解析模块的实战分享
哪个券商公司开户佣金低又安全又可靠
Which securities company has a low, safe and reliable account opening commission
买卖其实也有风险