我正在使用SpringBoot api并使用具有以下属性设置的H2数据库.
spring.h2.console.enabled=true
spring.datasource.name=test
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.datasource.initialization-mode = embedded
spring.datasource.url=jdbc:h2:mem:test
spring.jpa.hibernate.ddl-auto = update
Run Code Online (Sandbox Code Playgroud)
当我想使用浏览器通过' http:// localhost:8082/h2-console ' 查看H2数据库控制台时,在浏览器中打开一个带有连接和测试连接按钮的屏幕.当我单击"测试连接"时,它会返回成功,但是当单击"连接"按钮时,会出现localhost拒绝连接的错误.
使用 webflux 时,无法在 localhost:8080/h2-console 访问 H2 db。我在某处读到这仅在开发基于 Servlet 的应用程序时可用。但是我正在将 Webflux 与 Netty 一起使用。那么有没有办法在这样的应用中看到h2控制台呢?