今天啓動服務的時候,發現有一個服務一直啓動不起來,報錯以下:java
Caused by: java.sql.SQLException: null, message from server: "Host '192.168.0.10' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"
這裏的錯誤已經很明確了,就說某一個ip產生了大量的錯誤連接,而後這個IP就被鎖了,若是要解除鎖定,就用mysql自帶的名命令'mysqladmin flush-hosts'解鎖便可。mysql
若是是遠程機器,能夠使用: mysqladmin flush-hosts -h 192.168.1.9 -P 3306 -u root -p
查看:show variables like 'max_connect_errors';
修改:set global max_connect_errors = 1000;
校驗:show variables like 'max_connect_errors';