HikariPool-1 - Failed to validate connection commysqlcjjdbcConnectionImpl73eb5f77 The last packet successfully received from the server was 185233 milliseconds ago The last packet sent successfully to
This error message indicates that a connection to the database server has failed because it was not validated within the configured wait_timeout period. The wait_timeout period is the time that the server waits for a response from a client before closing the connection.
To resolve this issue, you can try one or more of the following solutions:
-
Expire and/or test connection validity before use in your application: This involves checking the connection to ensure that it is still valid before using it in your application. You can use a connection pool to manage connections and set up a validation query to test the connection validity.
-
Increase the server configured values for client timeouts: You can configure the server to wait for a longer period before closing the connection. This can be done by adjusting the wait_timeout and interactive_timeout values in the MySQL configuration file.
-
Use the Connector/J connection property 'autoReconnect=true': This option automatically reconnects to the server if the connection is lost. However, this can cause performance issues and is not recommended for production environments.
-
Use a shorter maxLifetime value: This option limits the maximum lifetime of a connection, after which it is closed and a new connection is opened. This can help prevent connection issues caused by long-running processes
原文地址: https://www.cveoy.top/t/topic/gDIs 著作权归作者所有。请勿转载和采集!