JHipster从Hikari,liquibase,Springboot配置抛出错误 [英] JHipster throws error from Hikari, liquibase, Springboot configuration

查看:364
本文介绍了JHipster从Hikari,liquibase,Springboot配置抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用MySQL数据库设置Jhipster微服务并在Intellij终端中首次运行它后:Hikari,liquibase,Springboot配置,此日志引发错误:

after setting up Jhipster microservice with MySQL Database and run it for the first time in the Intellij terminal the: Hikari, liquibase, Springboot configuration, throws error with this log:

ERROR 8353 --- [  restartedMain] com.zaxxer.hikari.pool.HikariPool        : Hikari - Exception during pool initialization.
ERROR 8353 --- [  restartedMain] i.g.j.c.liquibase.AsyncSpringLiquibase   : Liquibase could not start correctly, your database is NOT read
ERROR 8353 --- [  restartedMain] com.zaxxer.hikari.pool.HikariPool        : Hikari - Exception during pool initialization.
ERROR 8353 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

推荐答案

该错误可能有很多原因,但是在计算机中本地设置了jHipster-API-gateway和Jhipster-Microservice之后,更改了MySql数据库的用户名和密码. 因此,您必须首先使用根用户名打开mysql cli 并在终端中输入以下命令:

this error maybe have lots of reason but after setup jHipster-API-gateway and Jhipster-Microservice locally in your machine change the username and password of your MySql database. so you must first open your mysql cli with the root username and type in the terminal this command:

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';

此命令将为您的本地计算机创建一个新用户.记住要更改"newuser"和密码"到您想使用的任何东西. 之后,您必须将全部权限授予用户,因此请在终端中键入以下命令:

this command will create a new user for your local machine. remember to change the "newuser" and "password" to whatever you want to use. after that you must give the full privilege to your user so type this command in terminal :

GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';

记住要更改"newuser"到您在上一个命令中设置的值.

remember to change the "newuser" to whatever you set in the previous command.

在API网关应用程序中打开此文件:

in the API gateway application open this file:

src/main/resource/config/application-dev.yml

src/main/resource/config/application-dev.yml

并更改此行:

    type: com.zaxxer.hikari.HikariDataSource
    url: jdbc:mysql://localhost:3306/JhipsterStarteruseUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
username: root
password:

对此:

    type: com.zaxxer.hikari.HikariDataSource
    url: jdbc:mysql://localhost:3306/JhipsterStarter?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
username: newuser
password: password

这篇关于JHipster从Hikari,liquibase,Springboot配置抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆