MySQL批量插入数据脚本
时间:2021-06-13 08:41:42|栏目:Mysql|点击: 次
MySQL批量插入数据脚本
#!/bin/bash
i=1;
MAX_INSERT_ROW_COUNT=$1;
while [ $i -le $MAX_INSERT_ROW_COUNT ]
do
mysql -uroot -proot dbname -e "insert into tablename (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
新建表格就可以了
create table afs_test( name varchar()32, age int(32), createTime datetime
插入十万的数据为./jiaoben.sh 100000
栏 目:Mysql
下一篇:linux下mysql 5.7.16 免安装版本图文教程
本文标题:MySQL批量插入数据脚本
本文地址:http://www.codeinn.net/misctech/140870.html






