MySQL batch insert data script, mysql insert script

Source: Internet
Author: User
Tags mysql insert

MySQL batch insert data script, mysql insert script

MySQL batch insert data script

#! /Bin/bashi = 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 doneexit 0

Create a table.

Create table afs_test (name varchar () 32, age int (32), createTime datetime

Insert 100,000 of data to./jiaoben. sh 100000

Articles you may be interested in:
  • Implementation Code for batch data insertion in MYSQL
  • How to Avoid unique indexes during MySQL batch insertion
  • Several methods and time for executing mysql batch insert in java
  • Read and Write python files and use mysql to insert examples in batches (use python to operate mysql)
  • Using shell scripts to insert data in mysql tables in batches
  • MySQL batch insert to optimize performance tutorial

Related Article

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.