MySQL BULK Insert data script

Source: Internet
Author: User

#!/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 @@ ZZFCTHOTFIXZ"

i=$ (($i + 1))

Sleep 0.05

Done


Exit 0


You can create a new form.

CREATE TABLE Afs_test (

Name varchar () 32,

Age Int (32),

Createtime datetime


Insert 100,000 of the data for./jiaoben.sh 100000

This article from "East God to a dozen five" blog, declined reprint!

MySQL BULK Insert data script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.