Ella_Wu

坚持你应该坚持的

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

posted @ 2020-05-22 10:30  Ella_Wu  阅读(1535)  评论(0编辑  收藏  举报