The number of connections on the MySQL server is not as good as 100% of the maximum number of connections. For more information, see the following section.
We often encounter "MySQL: ERROR 1040: Too connections". One is that the access traffic is indeed high and the MySQL server cannot resist it. In this case, we need to consider increasing the load on distributed reads from the server, the value of max_connections In the MySQL configuration file is too small:
Mysql> show variables like 'max _ connections ';
+ ----------------- + ------- +
| Variable_name | Value |
+ ----------------- + ------- +
| Max_connections | 256 |
+ ----------------- + ------- +
The maximum number of connections on this MySQL server is 256, and then query the maximum number of connections on the server response:
Mysql> show global status like 'max _ used_connections ';
In the past, the maximum number of connections on the MySQL server was 245, but the maximum number of connections on the server was 256. There should be no 1040 error. The ideal setting is:
Max_used_connections/max_connections * 100% ≈ 85%.
The maximum number of connections accounts for about 85% of the maximum number of connections. If the percentage is less than 10%, the connection to the MySQL server is too high.
Mysql multi-Table query implementation
Take you to understand mysql Variables
How to revoke permissions and delete MySQL users
How to implement a dynamic MySQL View
How to deal with MySQL function creation Problems