Jmeter测试Mysql

时间:2023-03-08 22:18:24
Jmeter测试Mysql

一、在测试计划下,找到Add directory or jar to classpath下填入jdbc驱动路径。

二、新建线程组。

三、在线程组下,添加配置元件—JDBC Connection Configuration。

  1、在Variable Name Bound to Pool中的Variable Name下,输入变量名。

  2、在Database Connection Configuration中的Database URL下,输入jdbc:mysql://数据库地址:3306/数据库名。

  3、在JDBC DRiver class下,输入org.gjt.mm.mysql.Driver(旧)或com.mysql.jdbc.Driver(新)都可以。

  4、输入Username和Password。

四、在线程组下,添加取样器—JDBC Request。

  1、在Variable Name Bound to Pool中的Variable Name下,输入变量名(要与上边保持一致)。

  2、在SQL Query中的Query Type下选择Select Statement。

  3、输入查询的语句。