SpringBoot问题,领导让用Pigx开发,连上不数据库

小刘
  • 524

领导花钱买个一个框架,让我用,不太会配置,求助一下,怎么改文件

报错

org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure

实在不知道怎么改

server:
  port: 8848
  tomcat:
    basedir: logs

db:
  num: 1
  user: ${MYSQL-USER:root}
  password: ${MYSQL-PWD:root}
  url:
    0: jdbc:mysql://${MYSQL_HOST:idatage-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:idatagex_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true


nacos:
  core:
    auth:
      system.type: nacos
      default.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
  security:
    ignore:
      urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**

spring:
  datasource:
    platform: mysql
  security:
    enabled: true

useAddressServer: true

回复
阅读 337
1 个回答

从报错看是连接数据库失败,建议检查一下网络,防火墙和数据库IP,端口的配置

你知道吗?

宣传栏