Home > Database > Mysql Tutorial > MYSQL Too many connections的处理_MySQL

MYSQL Too many connections的处理_MySQL

WBOY
Release: 2016-06-01 13:40:32
Original
1218 people have browsed it

bitsCN.com
MYSQL Too many connections的处理 当程序抛出异常:
 Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection,  message from server: "Too many connections"     1. 登录MYSQL, 进入 mysql/bin目录下:   mysql -u root -p    Enter password: (输入密码)    其中-u后跟的是用户名,-p要求输入密码,回车后在输入密码处输入密码。  在Mysql中,可以通过如下方式查询Mysql数据库当前连接的用户及会话信息:
 1. show full processlist;  (如果显示太多, 可以输入:show processlist;), 看一下是哪个数据库的间接过大.    2. 修改数据库连接数: 修改/etc/my.cnf里面的连接数:
    max_connections=20000   (这个根据自己服务的状况而定) 直接加到这个下面 [mysqld]   如果修改后, 过一会儿仍然过大, 就是看 processlist 里面的连接数据库最多的, 看一下连接那个数据库的程序是不是有问题卡住.
  bitsCN.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template