sysbench

安装sysbench

 

0.创建db数据库

CREATE DATABASE IF NOT EXISTS sbtest DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

1.创建10个表,生成测试数据,每张表有10万条数据
 sysbench ./oltp.lua --mysql-host=localhost  --mysql-port=3306 --mysql-user=root --mysql-password=123456 --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --threads=10 --time=120 --report-interval=10 prepare         

2.
sysbench ./oltp.lua --mysql-host=localhost --mysql-port=3306 --mysql-user=root --mysql-password=123456 --oltp-test-mode=complex --oltp-tables-count=10 --oltp-table-size=100000 --threads=10 --time=120 --report-interval=10 run >> /root/test/mysysbench.log


3.清空数据
sysbench ./oltp.lua --mysql-host=localhost --mysql-port=3306 --mysql-user=root --mysql-password=123456 cleanup

你可能感兴趣的:(Mysql)