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

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

报错

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

阅读 2.5k
1 个回答

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

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏