Reset MySQL Slave Settings

For MySQL 5.0 and 5.1, run STOP SLAVE, CHANGE MASTER TO MASTER_HOST='' and then RESET SLAVE.
For MySQL 5.5 and 5.6, run STOP SLAVE and then RESET SLAVE ALL.
For all versions, DO NOT USE master-user, master-host and master-password settings in my.cnf/my.ini, this may cause huge problems (it’s no longer supported from MySQL 5.5 onwards).

MySQL 5.0/5.1
mysql> stop slave;
Query OK, 0 rows affected (0.00 sec)
 
mysql> change master to master_host='';
Query OK, 0 rows affected (0.02 sec)
 
mysql> reset slave;
Query OK, 0 rows affected (0.04 sec)
 
mysql> show slave status\G
Empty set (0.00 sec)


MySQL 5.5+
mysql> stop slave;
Query OK, 0 rows affected (0,00 sec)
 
mysql> reset slave all;
Query OK, 0 rows affected (0,04 sec)
 
mysql> show slave status\G
Empty set (0,00 sec)

If you wish to stop a slave from starting it's slave threads on start up add the following to your my.cnf/my.ini (you can still start the slave via a start slave with this in place)
skip-slave-start

Please Register.


If you wish to add comments.
Cheers
Adam