jmeter 一次执行两次sql语句中的delete,报错【You have an error in your SQL syntax; check the manual that correspo】

今天用jmeter造测试数据,执行完毕的时候,想使用sql语句一次清理所有的新造的测试数据,方便进行下一次的流程测试,可是在jmeter里执行多条sql语句的时候报错:

jmeter 一次执行两次sql语句中的delete,报错【You have an error in your SQL syntax; check the manual that correspo】

【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 'DELETE FROM `xxx`.t_classify WHERE c_name LIKE '%����%'' at line 2】

说明解决方法的同时,把整个配置流程再重复下吧:

1.右键新建-添加--配置元件-->JDBC Connection Configuration,配置如下:注意增加【allowMultiQueries=true】前面有参数,用&符号连接,前面无参数,则为【jdbc:mysql://192.0.0.1:3306?allowMultiQueries=true】

jmeter 一次执行两次sql语句中的delete,报错【You have an error in your SQL syntax; check the manual that correspo】

2.右键-添加--simple--jdbc request

jmeter 一次执行两次sql语句中的delete,报错【You have an error in your SQL syntax; check the manual that correspo】

jmeter 一次执行两次sql语句中的delete,报错【You have an error in your SQL syntax; check the manual that correspo】

补充:在选择Query type类型的区别

Select Statement: 仅支持测试select语句,并且一次只能测试一条
Update Statement:支持测试非select语句,并且支持测试多条,里面若有select语句,则忽略,并且如果第一条语句为select语句,就会报错。

Callable Statement:只要语法正确,任何语句,再多的条数都支持