遇到的异常信息记录及解决思路

以前遇到的异常,通过各种办法解决掉了,但是都没有记录。后来再次遇到又记不起来了。。
!!! 这里记录平时工作、生活中遇到的异常。

一、Caused by: java.sql.SQLException: null, message from server: "Host ‘172.17.0.1’ is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts

原因:同一个ip在短时间内产生太多(超过mysql数据库max_connection_errors的最大值)中断的数据库连接而导致的阻塞;

解决办法:flush hosts;


二、[NACOS HTTP-POST] The maximum number of tolerable server reconnection errors has been reached

解决办法: 内存太小了


三、Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 66,232 milliseconds ago. The last packet sent successfully to the server was 66,233 milliseconds ago. is longer than the server configured value of ‘wait_timeout’. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property ‘autoReconnect=true’ to avoid this problem.

解决办法: MySQL得wait_timeout时间太短了,设置长一些。

你可能感兴趣的:(异常,java)