Pages

Thursday, April 26, 2012

Set max connections in MySQL database

Problem Statement: I was working with MySQL database and all of a sudden my code started throwing this error.

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection,  message from server: "Too many connections"

The similar kind of error I got in MySQL Workbench also. Here is the snapshot.























Problem Solution: Increase the maximum concurrent connections. You can do this with the command below.

set global max_connections = 1000;

1 comment:

  1. thank you..was breaking my head for almost 3 hours on this...

    ReplyDelete