Tomcat 报出如下错误:
java.sql.SQLException: null, message from server: "Host '*****' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"
解决办法:
执行命令 mysqladmin flush-hosts
原因:
mysql中默认的max_connect_errors是10,由于连接出错,造成这个数值高于10,当在访问的时候就被锁住了, 并屏蔽主机的进一步连接请求。
可以将这个值改的稍微高一些。
shell> mysqld_safe --max_connect_errors=10000
如果在给定主机上遇到该错误,首先应核实该主机的TCP/IP连接是否正确。如果存在网络问题,增加max_connect_errors变量的值不会有任何好处。
java.sql.SQLException: null, message from server: "Host '*****' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"
解决办法:
执行命令 mysqladmin flush-hosts
原因:
mysql中默认的max_connect_errors是10,由于连接出错,造成这个数值高于10,当在访问的时候就被锁住了, 并屏蔽主机的进一步连接请求。
可以将这个值改的稍微高一些。
shell> mysqld_safe --max_connect_errors=10000
如果在给定主机上遇到该错误,首先应核实该主机的TCP/IP连接是否正确。如果存在网络问题,增加max_connect_errors变量的值不会有任何好处。