java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempt

查询数据时控制台报错java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempt,在网上找了很久的资料这个问题终于得到解决

将配置文件中 url: jdbc:mysql://localhost:3306/my_test_db?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true 问号后面的部分替换为serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true 问题得到解决
#开发配置
  datasource:
    url: jdbc:mysql://localhost:3306/my_test_db?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true

你可能感兴趣的:(数据库,mysql,mysql,java,mybatis,jdbc)