Troubleshooting For Mysql "Too many connections"

[[email protected] ~]# mysql -S /var/lib/mysql/mysql.sock
ERROR 1040 (HY000): Too many connections

使用gdb命令对mysql的max_connections进行更改:

[[email protected] ~]# gdb -p $(cat /var/run/mysqld/mysqld.pid) -ex "set max_connections=500" -batch
[New LWP 25797]
[New LWP 25794]
[New LWP 25793]
[New LWP 25792]
[New LWP 25791]
[New LWP 25790]
[New LWP 25789]
[New LWP 25788]
[New LWP 25787]
[New LWP 25786]
[New LWP 25785]
[New LWP 25783]
[New LWP 25782]
[New LWP 25781]
[New LWP 25780]
[New LWP 25779]
[New LWP 25778]
[New LWP 25777]
[New LWP 25776]
[New LWP 25775]
[New LWP 25774]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f2e646f1b7d in poll () from /lib64/libc.so.6
[[email protected] ~]# mysql -S /var/lib/mysql/mysql.sock
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.30 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> show variables like ‘max_connections‘;
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections |  500  |
+-----------------+-------+
1 row in set (0.00 sec)

mysql>
时间: 2024-08-06 12:51:44

Troubleshooting For Mysql "Too many connections"的相关文章

mysql连接数太小,导致网站报错mysql:Too many connections

2017.9.14 一个网站上线前压力测试 网页打开报错mysql:Too many connections 一看就是mysql连接数设置过小导致的 进mysql查看连接数设置 show variables like '%max_connections%'; 只有151,怎么可以,果断决定提高到1000 PS:服务器性能可以的,哈哈 打开MySQL配置文件my.cnf添加 max_connections=1000  重启MySQL即可. 再次测试没问题咯! 方法二:命令行临时修改. set gl

mysql too many connections 问题

我的处理步骤: 第一步:首次确定你的服务可不可以重启,如果可以重启转第二步,如果不可以重启转第三步,这个主要考虑已经部署到客户现场或者正在使用中的数据库不能重启. 第二步:查找mysql的安装路径,这里分安装系统如果是linux系统,可以使用命令 where is mysql .如果是windows系统尝试了网上的办法,利用sql语句:select @@basedir from dual;但是在mysql too many状态下是无法执行sql的所以这种方法不可行.我也没找到好的方法,我是通过默

解决mysql 1040错误Too many connections的方法

1.可能是mysql的max connections设置的问题 2.可能是多次insert,update操作没有关闭session,需要在spring里配置transaction支持. 解决: 1.修改tomcat里的session 的time-out时间减少为20,(不是必改项) 2.对处理量大的对数据库insert或update的操作提供transaction支持. ======================================= 下面的是解决办法: com.mysql.jdb

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"

最简单的办法是因为你的my.ini中设定的并发连接数太少或者系统繁忙导致连接数被占满解决方式:打开MySQL安装目录打开MY.INI找到max_connections默认是100 .--实例 WINDOWS解决mysql Errno.: 1040错误XXXX info: Can not connect to MySQL server User: rootTime: 2004-5-20 3:00pmScript: /XXXX/XXXX.PHP Error: Too many connections

MySQL show status - show open database connections

table of contents MySQL show status - Open database connections MySQL show processlist MySQL show status - Summary MySQL "show status" FAQ: Can you demonstrate how to use the MySQL show statuscommand to show MySQL variables and status informatio

解决Can't connect to MySQL server on 'localhost' (10048)

解决Can't connect to MySQL server on 'localhost' (10048) 您使用的是Windows操作系统,此错误与一个注册表键值TcpTimedWaitDelay有关.减小Windows中TcpTimedWaitDelay时间可解决此类问题,默认情况下为240(未设置的情况下也是这个数值) 此项设置需要到注册表如下位置进行设置HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Paramete

MySQL影响性能的因素原因以及性能优化配置详解

(https://blog.csdn.net/kangshuo2471781030/article/details/79315577) 一.MySQL性能优化之-影响性能的因素 1.商业需求的影响 不合理需求造成资源投入产出比过低,这里我们就用一个看上去很简单的功能来分析一下. 需求:一个论坛帖子总量的统计,附加要求:实时更新 从功能上来看非常容易实现,执行一条SELECT COUNT(*) from 表名的Query 就可以得到结果.但是,如果我们采用不是MyISAM 存储引擎,而是使用的In

PHP爬虫:百万级别知乎用户数据爬取与分析

抓取了110万的用户数据,数据分析结果如下: 开发前的准备 安装Linux系统(Ubuntu14.04),在VMWare虚拟机下安装一个Ubuntu: 安装php5.6或以上版本: 安装MySQL5.5或以上版本: 安装curl.pcntl扩展. 使用PHP的curl扩展抓取页面数据 PHP的curl扩展是PHP支持的允许你与各种服务器使用各种类型的协议进行连接和通信的库. 本程序是抓取知乎的用户数据,要能访问用户个人页面,需要用户登录后的才能访问.当我们在浏览器的页面中点击一个用户头像链接进入

论mysql5.7.13性能优化之索引优化

防伪码:吾日三省吾身 一.MySQL 性能优化之-影响性能的因素 1. 商业需求的影响 不合理需求造成资源投入产出比过低,这里我们就用一个看上去很简单的功能来分析一下. 需求:一个论坛帖子总量的统计,附加要求:实时更新 从功能上来看非常容易实现,执行一条 SELECT COUNT(*) from 表名的 Query 就可以得到结 果.但是,如果我们采用不是 MyISAM 存储引擎,而是使用的 Innodb 的存储引擎,那么大 家可以试想一下,如果存放帖子的表中已经有上千万的帖子的时候,执行这条