Data source rejected establishment of connection, message from server: "Too many connections"
2017-09-19 20:06
519 查看
错误原因:
问题的解决:
同时修改bean配置
mysql配置
太多的连接数,登录用户过多,配置的mysql连接数过小,或者某些连接没有关闭,导致连接数过大。
问题的解决:
修改mysql的my.ini配置文件,网上的说法:mysql安装目录下的my.ini中设定的并发连接数太少或者系统繁忙导致连接数被占满。 而项目实际上部署在linux系统上,需要找到my.cnf的配置文件,一般在etc/my.cnf,找到这个文件,添加如下行: set-variable=max_connections=1000 set-variable=max_user_connections=500 set-variable=wait_timeout=200
同时修改bean配置
mysql配置
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="${driverClass}" /> <property name="jdbcUrl" value="${jdbcUrl}"></property> <property name="user" value="${user}" /> <property name="password" value="${password}" /> <!-- 连接池中保留的最小连接数,默认为:3 --> <property name="minPoolSize" value="10" /> <!-- 连接池中保留的最大连接数。默认值: 15 --> <property name="maxPoolSize" value="50" /> <!-- 初始化连接池中的连接数,取值应在minPoolSize与maxPoolSize之间,默认为3 --> <property name="initialPoolSize" value="10" /> <!-- 连接池为数据源缓存的PreparedStatement的总数 --> <property name="maxStatements" value="40" /> <!--连接池为数据源单个Connection缓存的PreparedStatement数 --> <property name="maxStatementsPerConnection" value="30" /> </bean>
相关文章推荐
- Data source rejected establishment of connection, message from server: "Too many connections"
- Data source rejected establishment of connection, message from server: "Too many connections"解决办法
- Data source rejected establishment of connection message from server: "Too many connections";
- Data source rejected establishment of connection, message from server: "Too many connections"
- Data source rejected establishment of connection, message from server: "Too many connections"
- Data source rejected establishment of connection, message from server: "Too many connections"
- Data source rejected establishment of connection, message from server: "Too many connections"
- Data source rejected establishment of connection, message from server: "Too many connections"
- Data source rejected establishment of connection, message from server: "Too many connections"
- Data source rejected establishment of connection, message from server: "Too many connections"
- MySQL Data source rejected establishment of connection, message from server: "Too many connections"
- Data source rejected establishment of connection, message from server: "Too many connections"解决办法
- mysql: Data source rejected establishment of connection, message from server: "Too many connections"
- Mysql的错误,待解决[已解决]Data source rejected establishment of connection message from server: "Too many connections";
- Data source rejected establishment of connection, message from server: "Too many connections"
- (2) Data source rejected establishment of connection, message from server: "Too many connections"解决办
- 由于没有发现潜在的递归导致MySQL链接数溢出:MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connec
- Data source rejected establishment of connection, message from server: "Too
- null, message from server: "Host 'PC-20130201IBXI' is blocked because of many connection errors; un
- mysql errors:message from server: "Host 'xxx' is blocked because of many connection errors; unblock