jmeter mysql数据库的操作

跟操作oracle 数据一样,也是要先引入驱动,配置数据元件。

mysql 的驱动,是在mysql官网上下载的。首先看看自己的mysql版本。防止版本不对。驱动一般下载最下的,会向下兼容。

C:\Users\Administrator>mysql --version  

mysql  Ver 8.0.12 for Win64 on x86_64 (MySQL Community Server - GPL)

打开mysql官网  ——》下载——》社区——》mysql连接器——》连接器/J 

这里选择独立平台,下载zip 包即可。

命令行登录到mysql :

C:\Users\Administrator>mysql -uroot -p

Enter password: ******

show databases;

use autotest;

show tables;

--emp 表;

mysql> desc emp;

+-------+-------------+------+-----+---------+----------------+

| Field | Type        | Null | Key | Default | Extra          |

+-------+-------------+------+-----+---------+----------------+

| id    | int(11)    | NO  | PRI | NULL    | auto_increment |

| name  | varchar(30) | YES  |    | NULL    |                |

| age  | int(3)      | YES  |    | NULL    |                |

| sex  | char(1)    | YES  |    | NULL    |                |

+-------+-------------+------+-----+---------+----------------+

以上是要测试的数据库及表。

配置数据库的URL及Driver,

 ?serverTimezone=UTC   ,这个不加的时候报错了,所以需要设置一个时区的参数。

Cannot create PoolableConnectionFactory (The server time zone value '???��������??��??' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.)

其他的操作,后续会继续不上。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容