- 突然出现这个错: Access denied for user ‘root’@‘localhost’ (using password: YES)
wc啊,我把数据库的配置文件搞错了应该
可以的配置文件:
datasource: #数据源
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.17.0.1:3306/hc_official_website_1?useUnicode=true&characterEncoding=UTF8&serverTime=Asia/Shanghai
filters: stat, wall, config
initial-size: 1
max-active: 100
max-wait: 60000
min-idle: 1
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: select 'x'
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-open-prepared-statements: 50
max-pool-prepared-statement-per-connection-size: 20
username: root
password: 123456
name: druidDataSource
不可以的:
datasource: #数据源
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.17.0.1:3306/hc_official_website_1?useUnicode=true&characterEncoding=UTF8&serverTime=Asia/Shanghai
filters: stat, wall, config
initial-size: 1
max-active: 100
max-wait: 60000
min-idle: 1
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: select 'x'
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-open-prepared-statements: 50
max-pool-prepared-statement-per-connection-size: 20
username: root
password: 123456
name: druidDataSource
我实在看不出有什么区别