jmeter mysql数据库的操作

2019-03-24  本文已影响0人  坚持未来

跟操作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.)

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

上一篇 下一篇

猜你喜欢

热点阅读