Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # usage: gendata 10000 # Generates 20000 rows data approx.
- #
- gendata(){
- (
- cat <<EOF
- use test;
- drop table if exists thavatab;
- create table thavatab(name char(144), no integer primary key);
- EOF
- echo "insert into thavatab values ('hello', 1 );"
- i=1
- if [ -n "$1" ]
- then
- limit=$1
- else
- limit=10000
- fi
- while [ $i -lt $limit ]
- do
- echo "insert into thavatab select 'hello', $i+no from thavatab;"
- ((i=$i*2))
- done
- ) | mysql -u root
- }
Add Comment
Please, Sign In to add comment