#!/bin/bashmysql
DB_IP=sql
DB_USER=bash
DB_PASSWD=ide
DB_NAME=it
a=98000000io
function addsql()function
{class
ine2=$1date
ine3=$2di
#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