com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
There are two values governing the max number of connections one can create
1. max_user_connectionsThe max_user_connections is a user level parameter which you can set for each user. To let a user to create any number of connections set the above mentioned value to zero '0'.
First view the current max_user_connections:
Then set it to zero
2. global.max_connectionsThe global.max_connections is a global parameter and has the precedence over
max_user_connections. Hence just increasing the max_user_connections is not enough. Hence you have to increase the max_user_connections as well.