Data source rejected establishment of connection, message from serverToo many connections error solution.
The meaning of the error here is: too many data source connections have been established, and the target data source refuses to connect.
Solution directory
Interim Option 1
Directly modify the maximum number of mysql connections,无需重启数据库
show variables like "max_connections"; #显示最大连接数,默认值151
show processlist; #显示当前连接数,我的连接数是152,已经超了
For the global settings directly below, you must add global, otherwise it will only take effect at the current moment. Because I use navicat to create a new query page to operate, if global is not added, this setting is only valid for the current query page, and our server still cannot connect! ! ! !
set global max_connections=1000; #设置最大连接数1000
show variables like "max_connections"; #显示最大连接数,此时发现1000
备注
: If navicat can't connect to the database, then you can only reset the number of connections by restarting the database!!!
final solution 2
The most fundamental solution is to find the mysql installation directory my.ini
, modify max_connections=1000, and 重启数据库
it will take effect permanently.
If there is one in the configuration file, modify it, if not, add it! ! ! ! Remember to restart the database
max_connections=1000
Summarize
Summary : A compromise solution is to use Solution 1 first in an emergency, and start the server first; then let the operation and maintenance students restart the database in the middle of the night. If you do not restart mysql, it will not be hot updated.