首页 > 数据库技术 > 详细

批量查询sql脚本

时间:2017-11-01 18:11:39      阅读:276      评论:0      收藏:0      [点我收藏+]
远程批量查询sql脚本
for i in {1..50}
do
sql_ip=172.168.0.${i}
 
information=`mysql -h ${sql_ip} -uroot -ppassword dbname -e ‘select name,value from setting where name = "name" UNION select name,value from setting where name = "code" ‘ |grep -v val
ue|awk -F ‘ ‘ ‘{print $2}‘|awk -F ‘\\‘ ‘{print $3}‘`
 
echo ${information} > information.txt
code=`cat information.txt`
token_tab=`mysql -h ${sql_ip} -uroot -ppassword dbname -e ‘select name,value from setting where name = "token"‘|grep -v value|awk -F ‘\\‘ ‘{print $3}‘`
echo ${token_tab} > token_file.txt
sed ‘s/0//g‘ token_file.txt > token.txt
token=`cat token.txt`
echo "${token} this name is "${code}"" >> integ.txt
done

批量查询sql脚本

原文:http://www.cnblogs.com/musen/p/7767717.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!