docker-compose配置一直出现 java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up #3370
xxl-job-admin | 20:41:05.910 logback [xxl-job, admin JobScheduleHelper#scheduleThread] ERROR com.zaxxer.hikari.pool.HikariPool - HikariCP - Exception during pool initialization.
xxl-job-admin | java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:894)
xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:819)
xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:444)
xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237)
xxl-job-admin | at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
xxl-job-admin | at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
xxl-job-admin | at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
xxl-job-admin | at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
我的docker-compose设置 mysql配置 db: image: mysql:latest hostname: db container_name: db environment:
错误
xxl-job-admin | 20:41:05.910 logback [xxl-job, admin JobScheduleHelper#scheduleThread] ERROR com.zaxxer.hikari.pool.HikariPool - HikariCP - Exception during pool initialization. xxl-job-admin | java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) xxl-job-admin | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:894) xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:819) xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:444)
xxl-job-admin | at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:237)
xxl-job-admin | at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
xxl-job-admin | at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
xxl-job-admin | at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
xxl-job-admin | at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)