Spring Boot 中如何启用 H2 的控制台

如何在 Spring Boot 中如何启用 H2 的控制台?



你需要在你的 application.properties 文件中启用配置:


spring.h2.console.enabled=true


spring.h2.console.path=/h2-console


具体的配置你可以参考页面 Spring Boot 使用 H2 数据库的控制台(Console) 中的内容。


运行后的界面如下:

2020-04-04_23-00-12.jpg?version=1&modificationDate=1586055713687&api=v2

使用的端口,是你 Spring Boot 运行使用的端口。


登录进去数据库后查看的界面:

2020-04-04_23-00-33.jpg?version=1&modificationDate=1586055713676&api=v2

你也可以访问 GitHub 上面的内容下载代码:

https://github.com/cwiki-us-demo/java-tutorials/tree/master/persistence-modules/spring-boot-persistence-h2-console


有关本内容的链接:

https://www.cwiki.us/display/SpringBootZH/questions/57938823

 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章