Database not found, and IFEXISTS=true, so we cant auto-create it

后端 未结 17 3043
不思量自难忘°
不思量自难忘° 2020-12-15 06:20

I am getting error after opening the h2 database console. I enter database name but it is showing database not found error:

Database \"C:/Users/Barlek

17条回答
  •  难免孤独
    2020-12-15 07:17

    Adding to @Prateik Upadhyay's answer, if you want to rename your db connection name to something else the only thing that worked for me is below. I am using spring boot 2.2.4 version. with h2 1.4.200 version.

    spring.jpa.hibernate.ddl-auto=create-drop
    spring.datasource.url=jdbc:h2:~/MyComponentDB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE;DB_CLOSE_DELAY=-1;MODE=Oracle
    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
    

提交回复
热议问题