1 Check the MySQL configuration of the two parameters max_connections "maximum number of connections" and wait_timeout "connection idle Wait Long", if the default value, please modify:
View the value of the maximum number of connections.
Mysqladmin-uusername-ppassword variables |find "Max_con"
Note that there is no space between-U and the user name in the above command, between-P and the password.
Set the new maximum number of connections
Set global max_connections=3000;
Set global wait_timeout=10;
And then restart MySQL to fix it.
or open the MySQL installation directory to open My.ini find Max_connections (on the 93rd line) by default is 1001-like settings to 500~1000 more appropriate, restart MySQL, so that 1040 errors will be resolved.
max_connections=1000
Be sure to restart MySQL to take effect
Of course, this solves the problem we still need to check is that the statement problem, we can use MySQL slow query log to enter the solution, this is not introduced, we can find on their own site on MySQL slow query log article Oh.