MySQL has is a maximum number of concurrent connections permitted to access the database, defined by the max_connections variable. The default value for max_connections is 151, and if the error Too Many Connections occurs, it means all connections are being used by other clients.

If the “Too many connections” error is encountered frequently, the max_connections value can be increased temporarily by setting the global value as a MySQL command or increased permanently by explicitly defining the variable in the configuration file. RAM is allocated for each open connection and RAM availability should be evaluated prior to increasing the number of max connections. The variable max_connections controls the number of connections (file descriptors) allowed to be open, although the operating system may impose a limit on open files, so this must be reviewed as well.

Summary: If the error Too Many Connections is encountered with respect to a MySQL database, it is possible to increase the max_connections variable either temporarily or permanently. Consideration must be placed on available RAM as well as the operating system’s limits for the number of open files.

Share This