1
2
3
4
5
|
#!/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'"
|
本文转自 swq499809608 51CTO博客,原文链接:http://blog.51cto.com/swq499809608/1403840