java.net.ConnectException: Connection timed out: connect


java.net.ConnectException: Connection timed out: connect 

问题:无法连接至数据库,连接超时。

java.net.ConnectException: Connection timed out: connect

解决:

检查项目中数据库连接相关的配置项是否正确!

spring.jpa.database=mysql
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/db?allowMultiQueries=true&autoReconnect=true&useUnicode=true&characterEncoding=utf-8
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.username=sa
spring.datasource.password=123

相关阅读 >>

Java 获取当前时间的年月日时分秒

Java实现https发送get和post请求

Java中将list集合用逗号隔开进行拼接成字符串

Java.net.connectexception: connection timed out: connect

为什么 Java 不支持运算符重载?

Java 和 c++ 的区别 ?

servletrequest转httpservletrequest设置header之后取不到header的问题

Java 中的异常处理

Java 中 string 和 int 类型的互相转化

Java中使用lambda表达式检查list集合是否存在某个值

更多相关阅读请进入《Java》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...