问题
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
回答1:
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';
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';
remember to change the "newuser" to whatever you set in the previous command.
in the API gateway application open this file:
src/main/resource/config/application-dev.yml
and change this line:
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:
to this :
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
来源:https://stackoverflow.com/questions/62494718/jhipster-throws-error-from-hikari-liquibase-springboot-configuration