首页 > 代码库 > mysql主从连接报错ERROR 1201

mysql主从连接报错ERROR 1201

做主从同步时的报错:

mysql> change master to master_host=‘192.168.10.151‘,master_user=‘repl‘,master_password=‘zrer90‘,master_log_file=‘mysql2-bin.000004‘,master_log_pos=98;

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, 1 warning (0.00 sec)

mysql> reset slave ;

Query OK, 0 rows affected (0.00 sec)

然后在设置连接主服务器:

mysql> change master to master_host=‘192.168.10.151‘,master_user=‘repl‘,master_password=‘zrer90‘,master_log_file=‘mysql2-bin.000004‘,master_log_pos=98;

Query OK, 0 rows affected (0.05 sec)