#!/bin/bash
DB_IP=
DB_USER=
DB_PASSWD=
DB_NAME=
a=98000000
function addsql()
{
ine2=$1
ine3=$2
#sql1="update 表名 set 列明= ${ine2} where ID= ${ine3};";
sql1="update 表名 set SEX=0 where ID= ${ine3};";
echo $sql1
mysql -u $DB_USER -h ${DB_IP} -p${DB_PASSWD} $DB_NAME -e "$sql1"
}
function readname()
{
while read line
do
echo $line
sql1="update 表名 set 列名='${line}' where ID=${a} ;"
#sql1="update 表名 set SEX=0 where ID= $a;";
mysql -u $DB_USER -h ${DB_IP} -p${DB_PASSWD} $DB_NAME -e "$sql1"
#addsql $line $a
a=$(($a+1))
echo "banana:"$a
if [ $a -gt 98186387 ];
then
exit
fi
done < /root/nickname20160616.txt
}
for((t=0;t<=30;t++));
do
readname
echo "pingguo:" $a
if [ $a -gt 98186387 ];
then
exit
fi
done