关于mysql主从 ERROR 1201 (HY000): Could not initialize master info structure

关于mysql主从 ERROR 1201 (HY000): Could not initialize master info structure提示mysql错误代码。

mysql互为主从,但是在SLAVE执行CHANGE MASTER时,出现这个错误: ERROR 1201 (HY000): Could not initialize master!

mysql>

mysql> slave stop;

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> change master to master_host='192.168.100.10',master_user='replication',master_password='123456',master_log_file='updatelog.000004',master_log_pos=106;

ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log

网上查了一些资料,终于找到一个很好的解决办法(如下):

mysql> slave stop;

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='192.168.100.10',master_user='replication',master_password='123456',master_log_file='updatelog.000004',master_log_pos=106;

Query OK, 0 rows affected (0.05 sec)

mysql> slave start;

Query OK, 0 rows affected (0.00 sec)

这样就完成mysql主从设置了,你可以执行

mysql > show slave status G;

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

出现这个问题的原因,应该是以前mysql做过主从!

您可以选择一种方式赞助本站

支付宝转账赞助

支付宝扫一扫赞助

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

图片 表情