Mysql 如果数据库端口错误(数据库服务器不可用或关闭),则应启动Spring引导
我有spring boot应用程序,作为我的应用程序的一部分,我有mysql数据库。有时我忘记打开mysql端口,因此我的应用程序无法启动Mysql 如果数据库端口错误(数据库服务器不可用或关闭),则应启动Spring引导,mysql,spring,Mysql,Spring,我有spring boot应用程序,作为我的应用程序的一部分,我有mysql数据库。有时我忘记打开mysql端口,因此我的应用程序无法启动 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not receiv
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:590)
它应该以警告消息开头,提前感谢。的可能重复即使您成功地启动它而没有任何错误,但在执行实际请求时,它也会失败。我宁愿让它在启动时失败,也不愿在运行时失败。