我正在使用jhipter创建一个应用程序,当我更改数据源中的地址和liquibase的pom.xml时,我始终为dev和prod设置mysql,我总是遇到错误用户'root'@'的访问被拒绝本地主机”(使用密码:是)
我还执行了在上授予所有特权。到'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>
对于application-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
答案 0 :(得分:1)
使用仅包含数字的密码时,需要在其周围加上引号,以将其解释为字符串值。
password: "0000"