首页 > 解决方案 > Springboot hibarnate 错误:通过 JDBC 语句执行 DDL 时出错,数据库名称有条形符号

问题描述

如题,我的springboot版本是2.1.4,</p>

数据库名称 eg:my-db

它在从 1.5V 升级之前可用

现在我在模型中添加一列,然后程序启动时会抛出这个错误......</p>

application.yaml set:ddl-auto: update


org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL ”alert table my-db.test add column name varchar(25)“ via JDBC Statement

标签: mysqlhibernatespring-bootspring-data-jpa

解决方案


警报表 my-db.test 添加列名 varchar(25);

不知道你从哪里得到这个查询。此查询的正确语法是:

更改表 my-db.test 添加列名 varchar(25);


推荐阅读