【问题标题】:not able to start application jhipster with mysql无法使用 mysql 启动应用程序 jhipster
【发布时间】: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&amp;hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&amp;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

【问题讨论】:

    标签: mysql spring jhipster


    【解决方案1】:

    当使用仅包含数字的密码时,需要在其周围加上引号被解释为字符串值。

    password: "0000"
    

    【讨论】:

      猜你喜欢
      • 2021-12-25
      • 1970-01-01
      • 1970-01-01
      • 2017-05-09
      • 1970-01-01
      • 2017-10-09
      • 1970-01-01
      相关资源
      最近更新 更多