在Heroku上部署JHipster,使用远程MySQL数据库无法工作。

huangapple go评论83阅读模式
英文:

deploying jhipster on heroku with remote Mysql db not working

问题

我在我的MySQL服务器上的"管理访问主机"中添加了%%.eu-west-1.compute.amazonaws.com,就像这样:

在Heroku上部署JHipster,使用远程MySQL数据库无法工作。

在运行了以下命令之后:

git push heroku master

命令以如下错误结束:

remote: ----------------------------
remote: [INFO]     driver: com.mysql.jdbc.Driver
remote: [INFO]     url: jdbc:mysql://red.obambu.com:3306/dbName?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC
remote: [INFO]     username: username
remote: [INFO]     password: *****
remote: [INFO]     use empty password: false
remote: [INFO]     properties file: null
remote: [INFO]     properties file will override? false
remote: [INFO]     prompt on non-local database? false
remote: [INFO]     clear checksums? false
remote: [INFO]     changeLogDirectory: null
remote: [INFO]     changeLogFile: src/main/resources/config/liquibase/master.xml
remote: [INFO]     context(s): null
remote: [INFO]     label(s): null
remote: [INFO]     number of changes to apply: 0
remote: [INFO]     drop first? false
remote: [INFO] ------------------------------------------------------------------------
remote: Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] BUILD FAILURE
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] Total time:  14.608 s
remote: [INFO] Finished at: 2020-08-21T14:36:52Z
remote: [INFO] ------------------------------------------------------------------------
remote: [ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.9.0:update (default-cli) on project test-aoo:
remote: [ERROR] Error setting up or running Liquibase:
remote: [ERROR] liquibase.exception.DatabaseException: java.sql.SQLException: Access denied for user 'username'@'ec2-11-111-111-11.eu-west-1.compute.amazonaws.com' (using password: YES)
remote: [ERROR] -> [Help 1]
remote: [ERROR]
remote: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote: [ERROR]
remote: [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
remote: Waiting for release... failed.
To https://git.heroku.com/quiet-fjord-74508.git
   34d00e5..3ad885c  master -> master

注意:我的数据库密码类似于test@@123$$*

有什么帮助吗?

英文:

i have added % and %.eu-west-1.compute.amazonaws.com on my Manage Access Hosts on Mysql server like that :

在Heroku上部署JHipster,使用远程MySQL数据库无法工作。

and directly after running this cmd :

git push heroku master

the cmd end with an error like that:

remote: ----------------------------
remote: [INFO]     driver: com.mysql.jdbc.Driver
remote: [INFO]     url: jdbc:mysql://red.obambu.com:3306/dbName?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC
remote: [INFO]     username: username
remote: [INFO]     password: *****
remote: [INFO]     use empty password: false
remote: [INFO]     properties file: null
remote: [INFO]     properties file will override? false
remote: [INFO]     prompt on non-local database? false
remote: [INFO]     clear checksums? false
remote: [INFO]     changeLogDirectory: null
remote: [INFO]     changeLogFile: src/main/resources/config/liquibase/master.xml
remote: [INFO]     context(s): null
remote: [INFO]     label(s): null
remote: [INFO]     number of changes to apply: 0
remote: [INFO]     drop first? false
remote: [INFO] ------------------------------------------------------------------------
remote: Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] BUILD FAILURE
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] Total time:  14.608 s
remote: [INFO] Finished at: 2020-08-21T14:36:52Z
remote: [INFO] ------------------------------------------------------------------------
remote: [ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.9.0:update (default-cli) on project test-aoo:
remote: [ERROR] Error setting up or running Liquibase:
remote: [ERROR] liquibase.exception.DatabaseException: java.sql.SQLException: Access denied for user 'username'@'ec2-11-111-111-11.eu-west-1.compute.amazonaws.com' (using password: YES)
remote: [ERROR] -> [Help 1]
remote: [ERROR]
remote: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote: [ERROR]
remote: [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
remote: Waiting for release... failed.
To https://git.heroku.com/quiet-fjord-74508.git
   34d00e5..3ad885c  master -> master

N.B : my db password is something like that : test@@123$$*

any help guys ?

答案1

得分: 2

你应该从密码中移除 @ 或者将其在你的URL中替换为 %40,以免与数据库URL中的 '@' 混淆。示例:

修改前:

jdbc:mysql://username:pass@word@localhost:3306/dbname

修改后:

jdbc:mysql://username:pass%40word@localhost:3306/dbname
英文:

You should remove @ from password or replace it with %40 in your URL to not confuse with the '@' in your database URL. example :

before :

jdbc:mysql://username:pass@word@localhost:3306/dbname

after :

jdbc:mysql://username:pass%40word@localhost:3306/dbname

huangapple
  • 本文由 发表于 2020年8月21日 22:46:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/63525060.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定