shell 中调用 mysql 操作
来源:互联网 发布:sd卡数据恢复 编辑:程序博客网 时间:2024/06/09 13:09
#!/bin/bash
#删除100个数据库中的1000个表的过期数据
DBHOST="127.0.0.1"
DBPWD="pwd"
DBUSER="root"
MYSQLBIN="/usr/local/mysql/bin/mysql"
for((dbindex = 0;dbindex < 100;dbindex++))
do
for((tabindex = 0;tabindex < 10;tabindex++))
do
if [ $dbindex -lt 10 ]; then
del="delete from gs_map_0${dbindex}.t_${tabindex}";
else
del="delete from gs_map_${dbindex}.t_${tabindex}";
fi
del=${del}" where Fcreate_time < UNIX_TIMESTAMP() - 86400"
bin=`${MYSQLBIN} -u${DBUSER} -p${DBPWD} -h${DBHOST} -e"${del}"`
$bin
#echo ${bin}
#echo $del >>/tmp/aaa.txt
sleep 5
done
done
#crontab configure
# 0 3 * * * clear.sh > /dev/null 2>&1
- shell 中调用 mysql 操作
- shell中操作mysql
- shell中操作mysql数据库
- shell中调用shell
- python调用shell链接mysql数据库进行操作
- shell调用mysql
- shell中调用mysql 原格式输出到文件里面
- shell 中调用另一个 shell
- shell操作mysql
- shell操作mysql
- shell操作mysql数据库
- shell操作mysql
- shell操作mysql
- Shell操作mysql数据库
- shell操作mysql
- shell 操作 mysql
- shell 操作mysql
- shell操作mysql
- DWZ框架Ajax开发视频教材
- C#设计模式(23种设计模式)
- debian 下的openssh 的完全配置笔记
- Struts2标签使用
- Communications link failure due to underlying exception
- shell 中调用 mysql 操作
- 大后台应用服务器框架
- 批量修改控件属性
- Teamspeak3集成要注意的问题
- asp.net检测网页特性
- C#连接六类数据库的代码集
- oracle里的常用命令
- Struts2页面开发中常用标签使用说明
- amixer的应用