jmeter测试mysql数据库 聚合报告error 100%,求教大家
本帖最后由 shinya 于 2012-7-22 09:48 编辑求教各位,我是纯新手一枚,这两天刚刚开始学习jmeter,
我依葫芦画瓢的试了一下测试数据库,用的是mysql,但是聚合报告里的error是100%,View Results Tree里显示红色的带三角形感叹号的JDBC Request,说实话,取样器结果我也不是很看得懂,
想请问一下,这到底是什么原因?
谢谢~~~
我把取样器结果也发上来
Thread Name: Thread Group 1-1
Sample Start: 2012-07-22 09:23:27 CST
Load time: 2004
Latency: 2004
Size in bytes: 0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 1
Response code: 08S01 0
Response message: java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.SocketException: java.net.ConnectException: Connection refused: connect
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused: connect
STACKTRACE:
java.net.SocketException: java.net.ConnectException: Connection refused: connect
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:143)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:225)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1805)
at com.mysql.jdbc.Connection.<init>(Connection.java:452)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.avalon.excalibur.datasource.JdbcConnectionFactory.newInstance(JdbcConnectionFactory.java:185)
at org.apache.avalon.excalibur.pool.ResourceLimitingPool.newPoolable(ResourceLimitingPool.java:672)
at org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.newPoolable(ValidatedResourceLimitingPool.java:178)
at org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcConnectionPool.newPoolable(ResourceLimitingJdbcConnectionPool.java:123)
at org.apache.avalon.excalibur.pool.ResourceLimitingPool.get(ResourceLimitingPool.java:402)
at org.apache.avalon.excalibur.pool.ValidatedResourceLimitingPool.get(ValidatedResourceLimitingPool.java:130)
at org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource.getConnection(ResourceLimitingJdbcDataSource.java:222)
at org.apache.jmeter.protocol.jdbc.config.DataSourceElement$DataSourceComponentImpl.getConnection(DataSourceElement.java:271)
at org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection(DataSourceElement.java:139)
at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:72)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:416)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271)
at java.lang.Thread.run(Unknown Source)
** END NESTED EXCEPTION **
Response headers:
SampleResult fields:
ContentType: text/plain
DataEncoding: UTF-8
谢谢大家~ jmeter测试的时候有加载对应的jar包么? 检察下你配置的数据库是否正确吧 端口错了,mysql默认端口是3306 看看mysql的odbc驱动和mysql的端口号,8080 是tomcat的 mysql默认端口号是3306 你也可以配置成自己想要的值 mysql默认端口号是3306 你可以配置成你需要的端口
页:
[1]