首页 技术 正文
技术 2022年11月17日
0 收藏 751 点赞 4,366 浏览 3248 个字

1.下载源码 tpcc-mysql-src.tgz

2.解压 tpcc-mysql-src.tgz

3.安装

[root@DBMysql mysql]# cd /home/mysql/tpcc-mysql/src
[root@DBMysql src]# export PATH=/usr/local/mysql/bin:$PATH
[root@DBMysql src]# make
cc -w -O2 -g -I. `mysql_config --include` -c load.c
cc -w -O2 -g -I. `mysql_config --include` -c support.c
cc load.o support.o `mysql_config --libs_r` -lrt -o ../tpcc_load
cc -w -O2 -g -I. `mysql_config --include` -c main.c
cc -w -O2 -g -I. `mysql_config --include` -c spt_proc.c
cc -w -O2 -g -I. `mysql_config --include` -c driver.c
cc -w -O2 -g -I. `mysql_config --include` -c sequence.c
cc -w -O2 -g -I. `mysql_config --include` -c rthist.c
cc -w -O2 -g -I. `mysql_config --include` -c neword.c
cc -w -O2 -g -I. `mysql_config --include` -c payment.c
cc -w -O2 -g -I. `mysql_config --include` -c ordstat.c
cc -w -O2 -g -I. `mysql_config --include` -c delivery.c
cc -w -O2 -g -I. `mysql_config --include` -c slev.c
cc main.o spt_proc.o driver.o support.o sequence.o rthist.o neword.o payment.o ordstat.o delivery.o slev.o `mysql_config --libs_r` -lrt -o ../tpcc_start
[root@DBMysql src]#

4.创建数据库导入预定脚本

[mysql@DBMysql tpcc-mysql]$ mysqladmin --defaults-file=/data/mysqldata/my.cnf -uroot -p123456 -P3306 -h192.168.0.45 create tpcc
Warning: Using a password on the command line interface can be insecure.
[mysql@DBMysql tpcc-mysql]$ mysql --defaults-file=/data/mysqldata/my.cnf -uroot -p123456 -P3306 -h192.168.0.45
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
| tpcc |
+--------------------+
mysql>导入预定脚本:
mysql> use tpcc
Database changed
mysql> show variables like '%storage_engine%';
+----------------------------+--------+
| Variable_name | Value |
+----------------------------+--------+
| default_storage_engine | InnoDB |
| default_tmp_storage_engine | InnoDB |
| storage_engine | InnoDB |
+----------------------------+--------+
3 rows in set (0.10 sec)mysql> source /home/mysql/tpcc-mysql/create_table.sql #注意脚本的执行权限
mysql> source /home/mysql/tpcc-mysql/add_fkey_idx.sql

5.初始化数据(不用指定端口号)

[mysql@DBMysql tpcc-mysql]$ ./tpcc_load 192.168.0.45 tpcc root 123456 10
*************************************
*** ###easy### TPC-C Data Loader ***
*************************************
<Parameters>
[server]: 192.168.0.45
[port]: 3306
[DBname]: tpcc
[user]: root
[pass]: 123456
[warehouse]: 10
TPCC Data Load Started...
Loading Item
.................................................. 5000
.................................................. 10000
.................................................. 15000
.................................................. 20000
很长很长世间
Orders Done.
Loading Orders for D=10, W= 10
.......... 1000
.......... 2000
.......... 3000
Orders Done....DATA LOADING COMPLETED SUCCESSFULLY.
[mysql@DBMysql tpcc-mysql]$

6.进行测试

[mysql@DBMysql tpcc-mysql]$ ./tpcc_start --help
***************************************
*** ###easy### TPC-C Load Generator ***
***************************************
./tpcc_start: invalid option -- -
Usage: tpcc_start -h server_host -P port -d database_name -u mysql_user -p mysql_password -w warehouses -c connections -r warmup_time -l running_time -i report_interval -f report_file -t trx_file
[mysql@DBMysql tpcc-mysql]$ ./tpcc_start -h 192.168.0.45 -P 3306 -d tpcc -u root -p 123456 -w 10 -c 10 -r 100 -l 300 -f /home/mysql/tpcc-mysql.log -t /home/mysql/tpcc_mysql.rtx--参数介绍
-w warehouses     --仓库数量
-c connections    --连接数量
-r warmup_time    --指定预热时间,默认10秒,主要目的是将数据加载到内存
-l running_time   --指定测试执行时间
-i report_interval --指定生成报告的间隔时间
-f report_file     --将测试中各项操作的记录输出到指定的文件中
-t trx_file        --输出更详细的操作信息到指定的文件中
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,087
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,562
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,412
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,185
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,821
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,905