赞
踩
1.启动导入项目(黑马品达权限控制)时报错java.sql.SQLNonTransientConnectionException: Could not create connection to database server
2.解决方案:将mysql的maven依赖版本改为mysql版本,并记得刷新maven配置哦。
3.其他可能的原因:mysql版本与mysql驱动,mysql8.x需要在url加入时区
spring:
datasource:
druid:
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver #mysql8.x
# com.mysql.jdbc.Driver mysql5.x
url: jdbc:mysql://127.0.0.1:3306/pd_auth?serverTimezone=GMT%2B8&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。