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