JavaEE - A计划(一年有效期) 扫二维码继续学习 二维码时效为半小时

(28评价)
优惠后 ¥859.00优惠前 ¥999.00 双十一全年最大力度限时优惠
1对1 答疑即时回复7天无理由退款30天价保提问必答

服务保障

1对1 答疑

提供专属的一对一在线答疑,快速答疑解惑。

即时回复

及时响应学习咨询,帮助解决问题。

7天无理由退款

购买后7天内可申请无理由退款。

30天价保

购买后30天内如遇降价,可申请价保。

提问必答

对于提问做到有问必答,帮您扫清学习过程中的种种障碍

SpringBoot连接数据库出问题,连接不上
lalalala发起了问答2019-06-09
3
回复
938
浏览

 

一开始操作数据库的时候不知道为啥3306端口连接不上,就换成了3307端口,配置信息那里也改了,还是连接不上

把驱动spring.datasource.driver-class-name=com.mysql.jdbc.Driver改成spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver也还是没用

#Thymeleaf 编码
spring.thymeleaf.encoding=UTF-8

#热部署静态文件
spring.thymeleaf.cache=false

#使用HTML5的标准
spring.thymeleaf.mode=HTML5

#使用H2控制台
spring.h2.console.enabled=true

#DataSource
spring.datasource.url=jdbc:mysql://localhost:3307/springbootdemo
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

#JPA
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update

所有回复
发表回复
你还没有登录,请先 登录或 注册!