<p>MySQL 设定同步 Replication, 将下述命令拆成两组输入, 如下述:</p><pre class="brush:bash;toolbar:false">1.mysql>CHANGEMASTERTOMASTER_HOST='master.example.com',MASTER_USER='repl',MASTER_PASSWORD='repl_password';
2.mysql>CHANGEMASTERTOMASTER_LOG_FILE='mysql-bin.000001',MASTER_LOG_POS=107;</pre><p>设定 Replication 完成后, start slave 无法?⒍? 出现下述错误讯息:</p><p>Could not initialize master info structure, more error messages can be found in the MySQL error log</p><p>要怎么解决呢?</p><p>MySQL Replication 出现 Could not initialize master info structure 修复</p><p>MySQL error log 看不出有什么错误讯息, 可看此篇的讨论: MySQL :: Could not initialize master info structure, more error messages can be found in the MySQL error log</p><p>下述直接写解法:</p><p>代码如下<span class="Apple-tab-span" > </span>复制代码</p><pre class="brush:bash;toolbar:false;">1.mysql>resetslave;#重点就是这行
2.mysql>CHANGEMASTERTOMASTER_LOG_FILE='mysql-bin.000001',MASTER_LOG_POS=107;#请依照自行环境设定
3.mysql>startslave;#就正常了.
4.重新设置slave,MASTER_LOG_FILE和MASTER_LOG_POS会被清空,所以需要重新设置.</pre>