当前位置:网站首页>增加mysql的最大连接数
增加mysql的最大连接数
2022-06-12 14:53:00 【猿小飞】
1.出现的错误
Too many connections
2.原因
一种原因就是MySQL配置文件中max_connections值过小。另外一种原因,就是服务器的访问量过高,MySQL服务器抗不住。
3.先确定当前机器的mysql的最大连接数
show variables like '%max_connections%';
4.设置最大连接数
4.1.临时设置有效
set GLOBAL max_connections=1024;接着去查看一下,看是否生效
show variables like '%max_connections%';注意了,这种设置方式,一旦mysql重启后,这样在mysql直接设置的变量就会失效。
4.2.永久设置有效
修改mysql配置文件my.cnf,在[mysqld]段中添加或修改max_connections值。
max_connections=1024
保存配置文件后,重启mysql即可。
5.进入服务器,通过端口查看访问的数量
netstat -an | grep 3306 | grep ESTABLISHED | wc -l
6.也可以查看具体的连接数
show processlist;
边栏推荐
- FIRST集与FOLLOW集白话版
- Industrial end: a new battlefield of 618
- 【Calendar】1. For globalization 2 But only date can be formatted by SDF 3 Month to -1 4 Week from Sunday is the first day
- Use Baidu AIP to obtain the text in the specified area of the screen
- Easygui query the company name in the document
- Element positioning of selenium
- 基于TensorRT的深度学习模型部署实战教程!
- Selenium advanced
- 三维重建系统 | L3增量运动恢复结构(增量SFM)
- Alibaba, Tencent et pingduo sont à la recherche d'une nouvelle logique pour l'Internet industriel
猜你喜欢

亿纬锂能拟募资90亿:刘金成骆锦红夫妇合计认购60亿 布局光谷

Detailed explanation of factory pattern (simple factory pattern, factory method pattern, abstract factory pattern) Scala code demonstration

【LDA】LDA主题模型笔记—主要是狄利克雷

粒子滤波学习记录

Dataset and dataframe in sparksql

C 字符串

webdriver入门

C escape character

SQL cross database injection
![[wechat applet] 2 Environmental preparation](/img/8d/7bb68ca7d10751a6e992a53c5eff4a.jpg)
[wechat applet] 2 Environmental preparation
随机推荐
jenkins相关
PTA:自测-3 数组元素循环右移问题 (20分)
Junit多线程的写法
C 操作符
Webdriver opens in full screen and a prompt "Chrome is under the control of automatic test software" appears in Chrome
安装PS软件时提示程序无法访问关键文件/目录,错误代码:41的解决方法
ES6新特性
Use Baidu AIP to obtain the text in the specified area of the screen
ADSL
C data type
Pointer related concepts
指针相关概念
Alibaba, Tencent et pingduo sont à la recherche d'une nouvelle logique pour l'Internet industriel
MAT的安装和使用
安凯微电子冲刺科创板:年营收5亿 小米产业基金是股东
Jenkins' RPC test project
三维重建系统 | L3双视角运动恢复结构(SFM双目SFM)
ROS 中 boost::bind( ) 的使用
selenium进阶
Kinect2.0+ORBSLAM2_with_pointcloud_map