Please answer some questions before submitting your issue. Thanks!
Which version of XXL-JOB do you using?
docker镜像版本2.3.0
Expected behavior
通过environment来配置参数之后应该连接的是参数中的数据库
Actual behavior
docker-compose.yml文件如下:
version: '3'
services:
xxl-job:
image: xuxueli/xxl-job-admin:2.3.0
environment:
PARAMS: '--spring.datasource.url=jdbc:mysql://192.168.0.205:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai --spring.datasource.username=qd_tongcheng --spring.datasource.password=xxx'
ports:
- "8080:8080"
deploy:
replicas: 1
placement:
constraints: - node.role == manager
networks: - qd-opt-overlay
networks:
qd-opt-overlay:
external:
name: qd-opt-overlay
Steps to reproduce the behavior
启动之后看到日志报错为(不明白为什么我已经指定了spring.datasource.url,却连的是本机的ip,192.168.0.170是部署服务器):
Caused by: com.mysql.cj.exceptions.CJException: Access denied for user 'qd_tongcheng'@'192.168.0.170' (using password: YES)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:129)
at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:794)
at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:719)
at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:687)
at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:136)
at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:469)
at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:174)
at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1350)
at com.mysql.cj.NativeSession.connect(NativeSession.java:157)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:847)
... 39 common frames omitted
^C
暂无答案!
目前还没有任何答案,快来回答吧!