zoukankan      html  css  js  c++  java
  • Jmeter数据库连接报错-Could not create connection to database server

    最近在整jmeter压测数据库,但是连接到本地数据库时一直连接不上;

    jmeter中报错信息是 Cannot create PoolableConnectionFactory (Could not create connection to database server.)

    查询了网络上的资料,很多人说是因为jar版本过低,我的Mysql是8.0.18的版本,jar是5.0.17的版本,确实是比较低;

    更换新版本jar包之后还是报错,jmeter中的报错信息一直没变,就去jmeter的运行窗口看了一下,发现报错如下:

     Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

    翻译:建议在没有服务器身份验证的情况下建立SSL连接,根据MySQL 5.5.45+、5.6.26+和5.7.6+的要求,如果没有设置显式选项,则必须默认建立SSL连接。为了符合不使用SSL的现有应用程序,verifyServerCertificate属性被设置为“false”。您需要通过设置useSSL=false显式禁用SSL,或者设置useSSL=true并为服务器证书验证提供信任存储。

    根据提示,在jmeter的JDBC Connection Configure配置中的Database Connection Configuration --> Database URL中的Url后面加上  '?useSSL=false'即可。

    示例 : jdbc:mysql://127.0.0.1:3306/test?useSSL=false

    如果有其他参数可以在问号后面使用&符号拼接,示例 : jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false   

    注意: 我加上 useSSL=false 这个后缀后jmeter中不知道为什么还是会报错,但是jmeter的运行窗口不再显示报错信息,后来重启了一下jmeter,问题解决!

  • 相关阅读:
    PHP发送邮件
    SQL删除字段及判断字段是否存在的方法
    密码MySQL的root的密码
    java socket 最简单的例子(server 多线程)
    php编写最简单的webservice
    SQL Server 存储过程与触发器
    手动创建最简单的JSP 文件
    Oracle 卸载步骤
    编写 WebService 程序
    eclipse 常用快捷键
  • 原文地址:https://www.cnblogs.com/wuaihua/p/12935662.html
Copyright © 2011-2022 走看看