【发布时间】:2018-07-03 11:52:28
【问题描述】:
我正在使用 jhipter 创建一个应用程序,当我更改数据源中的地址和 liquibase 的 pom.xml 时,我为 dev 和 prod 设置了 mysql,我总是遇到错误 Access denied for user 'root'@' localhost'(使用密码:YES)
我也执行了 GRANT ALL PRIVILEGES ON . TO 'root'@'localhost' 但总是同样的错误。 对于 pom.xml:
<configuration>
<changeLogFile>src/main/resources/config/liquibase/master.xml</changeLogFile>
<diffChangeLogFile>src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
<driver>com.mysql.jdbc.Driver</driver>
<url>jdbc:mysql://localhost:3306/crud</url>
<defaultSchemaName>crud</defaultSchemaName>
<username>root</username>
<password>0000</password>
<referenceUrl>hibernate:spring:com.semah.crud.domain?dialect=org.hibernate.dialect.MySQL5InnoDBDialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy</referenceUrl>
<verbose>true</verbose>
<logging>debug</logging>
</configuration>
对于应用程序-dev.yml:
spring:
profiles:
active: dev
include: swagger
devtools:
restart:
enabled: true
livereload:
enabled: false # we use Webpack dev server + BrowserSync for livereload
jackson:
serialization.indent_output: true
datasource:
driver: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://localhost:3306/crud?useUnicode=true&characterEncoding=utf8&useSSL=false
name: crud
username: root
password: 0000
hikari:
data-source-properties:
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
【问题讨论】: