MySQL在多行查询中打破长查询

问题描述

我使用MysqL docker容器开发应用程序。 我的应用程序成功连接到MysqL并适当执行了查询

我要在其上执行多行查询时出现问题。

例如:

-- liquibase format sql
--changeset alipour:13990724_1
select host,user,Select_priv
from user
where 1=1;

执行查询后,出现以下错误

ERROR 1064 (42000) at line 2: You have an error in your sql Syntax; check the manual that corresponds to your MysqL server version for the right Syntax to use near '--changeset alipour:13990724_1
select host,Select_priv
from' at line 1

我检查过的方法却出现了相同的错误

  • 在数据源URL上使用过allowMultiQueries=true
  • 查询保存在文件中,并通过MySQL命令对其进行了测试

我在带有liquibase的应用程序中使用spring boot进行数据库演化。

解决方法

一个 引起了问题。

谢谢@GMB的提示。

我改变了

--changeset alipour:13990724_1

-- changeset alipour:13990724_1

问题解决了。