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

后端 未结 17 3028
不思量自难忘°
不思量自难忘° 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:12

    Have you upgraded H2 recently? This could be the cause.

    This is related to the following H2 commit:

    https://github.com/h2database/h2database/commit/8b53f3999c6c5c3d5ca29020e2657968f4f59ec4

    and the change was made because of this exploit:

    https://www.exploit-db.com/exploits/45506

    This means that the default for H2 is now to not auto-create databases when run in standalone network mode.

    If you have read and understood the above, and you still want to allow the database to be auto-created, then just add the -ifNotExists flag to your h2 start command like this:

    java -cp h2*.jar org.h2.tools.Server -ifNotExists
    

提交回复
热议问题