Differences between revisions 2 and 3
Revision 2 as of 2004-11-25 20:09:59
Size: 1535
Editor: RaphaelCorre
Comment: Jar file name has changed
Revision 3 as of 2009-09-20 21:56:35
Size: 1537
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
In order for JMeter to access a MySQL database as a client, it needs a JDBC database driver. For MySQL this is called MySQL Connector/J and is available at [http://www.mysql.com/products/connector/j/]. Download Connector/J and unzip the file. This will produce a directory containing the Connector/J files. In this directory you will find the connector jar file (mysql-connector-java-''version''-ga-bin.jar). Copy this file to the JMeter lib directory. In order for JMeter to access a MySQL database as a client, it needs a JDBC database driver. For MySQL this is called MySQL Connector/J and is available at [[http://www.mysql.com/products/connector/j/]]. Download Connector/J and unzip the file. This will produce a directory containing the Connector/J files. In this directory you will find the connector jar file (mysql-connector-java-''version''-ga-bin.jar). Copy this file to the JMeter lib directory.

Benchmarking MySQL with JMeter

This page describes setting up JMeter to benchmark a MySQL database using JDBC queries.

Install the JDBC Driver for MySQL

In order for JMeter to access a MySQL database as a client, it needs a JDBC database driver. For MySQL this is called MySQL Connector/J and is available at http://www.mysql.com/products/connector/j/. Download Connector/J and unzip the file. This will produce a directory containing the Connector/J files. In this directory you will find the connector jar file (mysql-connector-java-version-ga-bin.jar). Copy this file to the JMeter lib directory.

Configure the JDBC Sampler

Start JMeter and under the test plan node create a Thread Group, and under that create a JDBC Request Sampler.

For MySQL the Driver Class should be com.mysql.jdbc.Driver.

The JDBC URL is of this form: jdbc:mysql://server/databaseName?user=username&password=password

The SQL Query String is the SQL Query you want to benchmark. Start with something simple: create a table in the test database and execute a 'desc' query against it.

Try It Out

Add a View Results in Table Listener to the Thread Group. When ready, start the JMeter test run. After a few seconds, sample results should start to appear in this table. Ensure that the checkbox in the Success? column is checked. If it is, your query returned okay. You can now make test plans using JDBC queries much as you would make tests for a website.

Happy benchmarking!

JMeterAndMySQL (last edited 2009-09-20 21:56:35 by localhost)