MySQL日常排错

Posted Jadear

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL日常排错相关的知识,希望对你有一定的参考价值。

1、mysql从库 Failed to open the relay log

在配置MySQL主从复制的过程中,遇到了一个问题,提示:Could not initialize master info structure; more error messages can be found in the MySQL error log。

打开log日志发现是因为如下的原因:

111121 15:15:22 [ERROR] Failed to open the relay log ‘./dong-relay-bin.000002’ (relay_log_pos 1067)
111121 15:15:22 [ERROR] Could not find target log during relay log initialization

可以按照下面的方法解决:

  1. 在mysql日志目录下删除所有的relay logs,包括hostname-relay-bin.XXX, hostname-relay-bin.index and relay-log.info等等
  2. 重启mysql服务

 

以上是关于MySQL日常排错的主要内容,如果未能解决你的问题,请参考以下文章