根据官网说明,reset master 后binlog 会从000001开始:
RESET MASTER removes all binary log files that are listed in the index file, leaving only a single, empty binary log file with a numeric suffix of .000001, whereas the numbering is not reset by PURGE BINARY LOGS.
但做reset master测试的时候,确实从000010开始:
mysql> show master logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.000010 | 328 |
+------------------+-----------+
1 row in set (0.00 sec)
mysql> flush logs;
Query OK, 0 rows affected (0.01 sec)
mysql> show master logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.000010 | 375 |
| mysql-bin.000011 | 371 |
+------------------+-----------+
2 rows in set (0.00 sec)
手工在OS级别删除所有binlog 文件后,在测试,恢复正常:
[root@www.cndba.cn/dave data]# pwd
/mysql/data
[root@www.cndba.cn/dave data]# rm –rf mysql-bin.*
mysql> reset master;
Query OK, 0 rows affected, 3 warnings (0.00 sec)
mysql> show master logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.000001 | 328 |
+------------------+-----------+
1 row in set (0.00 sec)
原因不详,随笔记之。
版权声明:本文为博主原创文章,未经博主允许不得转载。