0

How to stop and reset/clear MySQL replication


This is a quick article that describes how to reset/delete/disable/clear MySQL replication in master-master or master-slave replication.

For each server that you wish to reset/clear MySQL replication on, do the following:

1. Enter MySQL prompt and run the following commands:

mysql> STOP SLAVE; CHANGE MASTER TO MASTER_HOST=''; RESET SLAVE;

2. Remove replication user(s). In this example, we remove replication user “replicator”:

 mysql> use mysql;
 mysql> delete from user where User="replicator";
 mysql> flush privileges;

3. Exit MySQL prompt and open up /etc/my.cnf – remove any reference to replication (eg: replicate-* master-* etc)

# vim /etc/my.cnf

4. Lastly, restart your MySQL instance:

# /etc/init.d/mysqld restart

 

Done.

 

Random Posts Recent Comments

  • Tony Says:

    Thanks it works! Just close the cmd windows and open a new one...

  • greenhart Says:

    I found another way around it. For the /format switch I used: /format:"%WINDIR%\system32\wbem\en-...

  • Jari Aalto Says:

    To determine OS, you can also use command lsb_release(1). See the options how to extract only part o...

  • shadovice Says:

    thanks! it worked like a charm, although there is still minor typo remained: rpm -Uvh http://downlo...

  • Joh Says:

    Great, thank you. Also works with the new version and Centos 6.3 without test repo, just install ...

  • sierprinsky Says:

    Muchas gracias por tu aporte :)...

  • kilby Says:

    The listed solution worked fine for me under Win7 64bit Though I had to run the copy as Asministr...

  • Viper5112 Says:

    The files are already in the C:\Windows\SysWOW64\wbem\en-US and they need to be in the system32 fold...

  • slowmOoh Says:

    Thanks...

  • Jørgen Says:

    @Jordan, I had the same problem also on Windows 7 64 bits. It worked for my user account and Admini...

Tag Cloud

backup mail backup mail server backup mailserver backup mx cd burner control multiple computers with one keyboard and mouse control panel DAG disk benchmark disk performance test DNS DNS check enable dag repo free cd burner free DNS check hdd benchmark http proxy install keyboard over network kloxo kloxo 64-bit kvm lxadmin lxadmin-master lxlabs mouse over network mtr ping plotter proxy proxy hide IP qmail repo RPM rpmforge share keyboard and mouse over network share keyboard over network share mouse and keyboard share mouse over network software kvm squid squid hide IP squid proxy trace traceroute tracert