Error updating database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table “USER” not found; SQL statement: INSERT INTO user
在idea中使用h2 一直报错说表找不到,在网上查询了一堆,也没找到一个顶用的无奈自己研究了一下,经过多次尝试,最终成功,具体步骤如下:
第一步:将Connection type 设置成Embedded 然后在 Path 处选择你要存放的位置

第二步:填写好path之后将下面自动生成的URL 拷贝一下在设置spring.datasource.url时能用到(记得填上 User和Password,以免运行的时候报账号密码不对)

第三步:第二步完成之后找到schemas文件夹下的PUBLIC

第四步:在PUBLIC处右键添加Table,即可完成表的创建

第五步:建表完成,将建表生成的URL拷贝到配置文件中





网友评论