想要恢愎数据库以前的资料,执行:show binlog events;屏幕就开始显示很多内容,心里烦(那有这么多没有用的LOG),还是删除一些去吧!
1.查找当
mysql> show binary logs;
+----------------+-----------+
| Log_name | File_size |
+----------------+-----------+
| mysql-bin.000001 | 150462942 |
| mysql-bin.000002 | 125 |
| mysql-bin.000003 | 106 |
+----------------+-----------+
2.删除bin-log(删除...
mysql bin日志文件清除sh
#!/bin/sh
## 2007-11-6
DELLOG="/usr/local/logs/del-sqlbin.log.`date +%d`"
DELTMP="/usr/local/logs/del-sqlbin.tmp"
MAIL_ADDR="xxx@xxx.xx"
exec &>$DELLOG
DT=`date +'%Y-%m-%d %T'`
SINGLE=0
sleep 30
hostname
echo `date +'%Y-%m-%d %T'`
echo "EXEC>>"
echo "PURGE MASTER LOGS BEFORE '$DT';"
echo "PURGE MASTER LOGS BEFORE '$DT';" >$DELTMP
mysql -uroot -pxxx <$DELTM...