我正在使用heroku来部署我的应用程序,当我尝试使用heroku加载我的h2控制台时,它抛出一个错误。
H2 控制台
抱歉,此服务器上禁用远程连接('webAllowOthers')。
我在 application.properties 文件中使用以下设置
jdbc:h2:tcp://localhost/~/test
spring.datasource.platform=h2
spring.datasource.url=jdbc:h2:mem:Roomy;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.enabled = true
spring.h2.console.settings.trace=true
spring.h2.console.settings.web-allow-others=true
我做了一些谷歌并添加了 .h2.server.properties
#H2 Server Properties
1=Generic H2 (Memory)|org.h2.Driver|jdbc:h2:mem:Roomy;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE|sa
webAllowOthers=true
tcpAllowOthers=true
webPort=8082
webSSL=false
请提及我做错了什么,我无法查看 h2 控制台有人可以帮忙吗?控制台在本地工作正常,在 Heroku 中数据库工作没有问题,但无法查看控制台。任何帮助将非常值得赞赏。
谢谢
柴塔尼亚
In application.properties
,添加以下设置。
spring.h2.console.settings.web-allow-others=true
就我而言,它有效。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)