spring boot中连接数据库报错500(mybatis)
spring boot中连接数据库报错500(mybatis)
pom.xml中的依赖
在文件中的数据库连接的情况
server.port=8880
test.hello=hello2
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=test
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
mybatis.mapper-locations=classpath:/mapper/**/*.xml
然后就一直报错500,提示未连接成功jdbc
后面发现只要将url改成
spring.datasource.url=jdbc:mysql://localhost:3306/test?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
就可以正常显示了,这说明默认是多么重要啊xdm

您能读到这儿,我呢是发自真心的感谢您,若要转载,还望请您带上链接

浙公网安备 33010602011771号