背景介绍:
- 公司某个产品测试性能需要回放访问数据库的流量包,通过解析流量包里的sql语句来新增业务数据。性能测试的语句较为单一,生成的业务数据也比较单一。
- 为了生成sql语句较全面、丰富点业务数据,就需要一个这样丰富的pacp包 使用的sql语句:
create user 'ttt'@'%' IDENTIFIED by 'Admin@12345';
grant select on *.* to ttt@'%';
revoke SELECT on *.* from ttt@'%';
drop user 'ttt'@'%';
create database ttt;
use ttt;
create table if not EXISTS Fees(tid int,Student varchar(20));
alter table Fees add name char;
alter table Fees drop column name;
insert into Fees values(1,'Elsa');
insert into Fees values(2,'zzz');
UPDATE Fees set Student = 'ttt' where Student='Elsa';
SELECT * FROM Fees where 1=1;
SELECT * FROM Fees order by tid;
SELECT tid from Fees group by tid having tid >=1;
DELETE FROM Fees;
DROP table if EXISTS Fees;
ALTER DATABASE ttt CHARACTER set=utf8;
DROP DATABASE ttt;
- 操作步骤如图所示