ERROR 1201 (HY000): Could not initialize master info structure解决方法

在做mysql主从复制的时候,在从服务器上进行show slave status\G;查看时 Slave_IO_Running: No与Slave_SQL_Running: No,然后stop slave;后stat slave出现如下错误:

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

解决方案:

mysql> stop slave;
Query OK, 0 rows affected (0.00 sec)


mysql> reset slave;(reset重置)
Query OK, 0 rows affected (0.01 sec)


mysql> change master to master_host='192.168.10.155',master_user='slave1',master_password='123456',master_log_file='mysql-bin.000023',master_log_pos=107;
Query OK, 0 rows affected (0.01 sec)


mysql> start slave;
Query OK, 0 rows affected (0.00 sec)


然后在执行show slave status\G;查看:

Slave_IO_Running: Yes
Slave_SQL_Running: Yes

这样就ok了,在网上查看出现这样的原始可能是以前的mysql做过主从!

你可能感兴趣的:(mysql)