sql="$1"
if [ "$sql"x = ""x ];then
cat | mysql -h10.10.10.${ip} -uroot test -N --local-infile
else
echo "$sql" | mysql -h10.10.10.${ip} -uroot test zhenai_crm -N --local-infile
fi
}
function main(){
init ""
echo "select * from tablename where createtime>='${yesterday}' and createtime<'${now}'" | executeSql >>res.tmp
}