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,问题解决!

  • 相关阅读:
    Java/android下哈希sha1和MD5的实现
    ANDROID SOCKET 开发
    UML补充
    TCP协议中的三次握手和四次挥手(转)
    uva 658 最短路
    uva 11280 最短路
    uva 10246 最短路
    uva 11747,kruskal 并查集
    uva 544 dijkstra
    uva 1395 瓶颈树
  • 原文地址:https://www.cnblogs.com/wuaihua/p/12935662.html
Copyright © 2011-2022 走看看