简体   繁体   English

适用于MySQL的JDBC连接器在JMeter中不起作用

[英]JDBC Connector for MySQL not working in JMeter

As per the problems this person was having; 根据这个人遇到的问题; JDBC Connector not working JDBC连接器不起作用

I'm running Debian 9.1 我正在运行Debian 9.1
I installed Java via the package manager 我通过程序包管理器安装了Java
I added Java to the path in /etc/config & added JAVA_HOME to the path in /etc/environment 我将Java添加到/ etc / config中的路径,并将JAVA_HOME添加到/ etc / environment中的路径
I then installed jmeter via the package manager 然后我通过软件包管理器安装了jmeter
I then downloaded the mysql-connector-java-5.1.44-bin.jar and copied this to /usr/share/jmeter/lib 然后,我下载了mysql-connector-java-5.1.44-bin.jar并将其复制到/ usr / share / jmeter / lib

But after all this, I still dont get the JDBC connection option under Add->Config Element within JMeter, nor do i get any options for JDBC within JMeter. 但是毕竟,我仍然没有在JMeter中的Add-> Config Element下获得JDBC连接选项,也没有在JMeter中获得JDBC的任何选项。

Can anyone help me as to what im doing wrong? 有人可以帮我了解我做错了什么吗?

While I am new to JMeter, I have successfully run simple "Hello World" HTTP requests queried from a PHP Script & a NodeJS script so far. 刚接触JMeter时,到目前为止,我已经成功运行了从PHP脚本和NodeJS脚本查询的简单“ Hello World” HTTP请求。

Update 更新资料
Added JMeter log by request 根据要求添加了JMeter日志
Jmeter log Jmeter日志

I have no idea what the problem was with Jmeter on my Debian machine... (as prior to this I was trying to use it on Ubuntu Server, and it had the same issue as Debian); 我不知道我的Debian机器上的Jmeter出了什么问题……(在此之前,我试图在Ubuntu Server上使用它,并且它与Debian有着相同的问题);

But anyway, I just installed the Oracle JDK & JMeter for Windows, on my old Windows 7 laptop, dropped in the JDBC connector to the lib directory - & immediately it had the option for 'JDBC Connection', which never appeared on either the Ubuntu or Debian installs. 但是无论如何,我只是在旧的Windows 7笔记本电脑上安装了Windows的Oracle JDK和JMeter,将其放在JDBC连接器中的lib目录中-并立即选择了“ JDBC连接”选项,而该选项从未出现在Ubuntu上或Debian安装。

So if anyone else runs into this issue on Ubuntu or Debian ~ I might suggest trying a Windows 7 VM for running it. 因此,如果有人在Ubuntu或Debian上遇到此问题,我建议您尝试使用Windows 7 VM来运行它。

Note here This was the JMeter I installed on Windows (I didn't get it from Apache): JMeter for Windows 请注意此处这是我在Windows上安装的JMeter(不是从Apache获得的): Windows的JMeter

在此处输入图片说明

For some reason I cannot find JMeter JDBC components either in Debian or in Ubuntu repositories, maybe it wasn't included by maintainers. 由于某种原因,我无法在DebianUbuntu存储库中找到JMeter JDBC组件,也许维护者未将其包含在内。

So instead of installing JMeter using package manager you can just download the latest JMeter version (which is JMeter 3.2 as of now while in repositories you have much older versions, 2.11/2.13) from the official website. 因此,无需使用软件包管理器来安装JMeter,您只需从官方网站下载最新的JMeter版本 (截至目前为JMeter 3.2 ,而在存储库中则有更旧的版本2.11 / 2.13)。 JMeter is pure Java-based application so all you will need to do in order to be able to use it is to install Java 8 or above . JMeter是纯基于Java的应用程序,因此要使用它,您需要做的就是安装Java 8或更高版本


Alternative option would be downloading jmeter-jdbc JAR appropriate to your JMeter version and dropping it under /usr/share/jmeter/lib/ext folder (super-user privileges might be required), this way you will get JDBC test elements. 另一种选择是下载适合您的JMeter版本的jmeter-jdbc JAR并将其放在/usr/share/jmeter/lib/ext文件夹下(可能需要超级用户特权),这样您将获得JDBC测试元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM