mysql-bin.log内容乱码引起的show binary logs 超时未响应


mysql-bin.log内容乱码引起的show binary logs 超时未响应

在mariadb迁移部署后,备份计划一直无法启动。查看报错是因为执行show binary logs命令时一直没有返回结果导致超时。执行flush binary logs也无法正常工作。查看binlog是正常工作的,执行show master status也有正常输出。

在排查mysql-bin.index文件是发现了异常

^@^@^@^@^@^@^@^@^@^@/var/lib/mysql/mysql-bin.000233
/var/lib/mysql/mysql-bin.000234
/var/lib/mysql/mysql-bin.000235
/var/lib/mysql/mysql-bin.000236
/var/lib/mysql/mysql-bin.000237
/var/lib/mysql/mysql-bin.000238
/var/lib/mysql/mysql-bin.000239
/var/lib/mysql/mysql-bin.000240
/var/lib/mysql/mysql-bin.000241
/var/lib/mysql/mysql-bin.000242
/var/lib/mysql/mysql-bin.000243
/var/lib/mysql/mysql-bin.000244

对比另一台工作正常的服务器文件发现,文件头多一些特殊字符,正常的文件索引内容如下:

/var/lib/mysql/mysql-bin.000233
/var/lib/mysql/mysql-bin.000234
/var/lib/mysql/mysql-bin.000235
/var/lib/mysql/mysql-bin.000236
/var/lib/mysql/mysql-bin.000237
/var/lib/mysql/mysql-bin.000238
/var/lib/mysql/mysql-bin.000239
/var/lib/mysql/mysql-bin.000240
/var/lib/mysql/mysql-bin.000241
/var/lib/mysql/mysql-bin.000242
/var/lib/mysql/mysql-bin.000243
/var/lib/mysql/mysql-bin.000244

把索引文件的中的特殊字符删除,执行flush binary logs命令后,可以正常查询到binary logs列表。

声明:初心|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - mysql-bin.log内容乱码引起的show binary logs 超时未响应


愿你勿忘初心,并从一而终