萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> mysql教程 >> 解決mysql報錯ERROR 1201 (HY000):Could not initialize master info structure

解決mysql報錯ERROR 1201 (HY000):Could not initialize master info structure

mysql報錯ERROR 1201 (HY000):Could not initialize master info structure錯誤許多朋友不知道如何解決,下面小編來為各位整理一下。

在做mysql主從復制時遇到個ERROR 1201 (HY000): Could not initialize master info structure .出現這個問題的原因是之前曾做過主從復制!

解決方案是:

運行命令 stop slave;
成功執行後繼續運行 reset slave;

然後重新設置主從復制。

具體過程如下:

mysql> change master to master_host='127.0.0.1', master_user='user', master_pass 
word='user', master_log_file='mysql-bin-000202', master_log_pos=553; 
ERROR 1201 (HY000): Could not initialize master info structure; more error messa 
ges can be found in the MySQL error log 
mysql> stop slave; 
Query OK, 0 rows affected, 1 warning (0.00 sec) 
 
mysql> reset slave; 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> change master to master_host='127.0.0.1', master_user='user', master_pass 
word='user', master_log_file='mysql-bin-000202', master_log_pos=553; 
Query OK, 0 rows affected (0.11 sec)

copyright © 萬盛學電腦網 all rights reserved