A site that uses a MySQL database, "Too many connections" error occurs when there are too many access connections. There are two cases of this error, one is that the Web site access is too large, the server can not afford, at this time should consider load balancing or other ways to reduce server pressure. Another situation is that MySQL's maximum number of connections is set too small, and when the traffic is slightly larger, there are too many connections.
MySQL default maximum number of connections is 100, you can use the following command in the MySQL client to view
Mysql>
ShowVariables
like' Max
_connections ' ;
This command will result in output similar to the following:
+-----------------+-------+
| variable_name | Value |
+-----------------+-------+
| max_connections | 2000 |
+-----------------+-------+
1 row in Set (0.00 sec)
To modify the maximum number of MySQL connections, simply modify the max_connections value in the MY.CNF configuration file and restart MySQL. If the max_connections entry is not found in the My.ini file, you can add the following entries yourself
Max_connections = 20
MySQL View and modify the maximum number of connections