RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
生成大量测试数据脚本
生成大量数据来测试:
create table t1 (id int not null primary key auto_increment,age int,name varchar(20),createtime date);
create index idx_age_name_create on t1(age,name,createtime);


vi create-data.sh
#!/bin/bash


i=1;
MAX_INSERT_ROW_COUNT=$1;
while [ $i -le $MAX_INSERT_ROW_COUNT ]
do
    MySQL -uroot -p123456 test -e "insert into t1 (name,age,createtime) values ('HELLO$i',$i % 99,NOW());"
    d=$(date +%M-%d\ %H\:%m\:%S)
    echo "INSERT HELLO $i @@ $d"    
    i=$(($i+1))
    sleep 0.05
done


exit 0




执行:
sh create-data.sh 10000

当前标题:生成大量测试数据脚本
当前URL:http://cqwzjz.cn/article/jdecci.html