Com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:Data Source rejected establishment of Connection, message from server: "Too many connections"
Cause: Because the number of concurrent connections set in the My.ini in your MySQL installation directory is too low or the system is busy, the number of connections is fully occupied
How to resolve:
Open MySQL install directory open My.ini find Max_connections (in about line 93rd) default is 1001 like set to 500~1000 more appropriate, restart MySQL, so 1040 error is solved.
max_connections=1000
Specific steps:
The default number of connections for a 1.Mysql database is 100.
2. The default value of 100 is not sufficient for the general program, if you just debug the program on your own computer, you may not find this problem, because the debugger will often restart Tomcat.
3. This is especially true if the hibernate framework is used for database operations.
4. Workaround: Increase the number of MySQL connections. In the MySQL installation file, locate the My.ini file and find it in the
max-connections=100, make this 100 bigger, straight to a 1000.
PS: The specific need to modify the value according to the actual situation of the project depends on ...
MySQL connection problem: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException