---
title: "mysql 'Too many connections'"
author: "chenchangqun"
date: "2014-07-28T16:42:10Z"
tags: []
categories: ["互联网"]
slug: "mysql-too-many-connections"
draft: false
lastmod: "2014-07-28T16:42:10Z"
id: 2097388
url: "https://chenchangqun.iteye.com/blog/2097388"
---

server端运行一段时间以后,数据库异常

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"

原因：连接池中的连接没有关闭。
解决：我这里是 dao层的调用没有被事务管理，导致连接没有关闭。