Error: "could not initailize master info structure" while doing Master Slave Replication in MySQL

user619684 picture user619684 · Feb 17, 2011 · Viewed 54k times · Source

I am trying to do Master Slave Replication for MySQL. When i am typing the following command:

CHANGE MASTER TO MASTER_HOST='10.1.100.1', MASTER_USER='slave_user', MASTER_PASSWORD='slave_password', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=451228;
mysql> START SLAVE;

it throws the following error:

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

Any help would be greatly appreciated.

Answer

Neo picture Neo · Mar 29, 2012

TRY TO RESET IT, IT DOES MAGIC! ON SLAVE THE SLAVE MYSQL COMMAND TYPE:

RESET SLAVE;

THEN TRY AGAIN:

CHANGE MASTER TO MASTER_HOST='10.1.100.1', MASTER_USER='slave_user', MASTER_PASSWORD='slave_password', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=451228;
mysql> START SLAVE;