MySQL bin log 处理手段

#!/bin/sh
/usr/local/mysql/bin/mysql --default-character-set=utf8 -h127.0.0.1 -u root -p123456 -e "show master status" > /root/master_binlog
binlog_pos=`grep mysql-bin /root/master_binlog | awk '{print $1'}`
echo $binlog_pos
/usr/local/mysql/bin/mysql -h127.0.0.1 --default-character-set=utf8 -u root -p123456 -e "purge binary logs to '$binlog_pos'"


你可能感兴趣的:(TO,mysql,binary,purge,logs)