How to disable MySQL replication on master/master andmaster/slave setups

The following guide shows how to disable and remove mysql replication from two or more mysql servers. These steps can be used for master/slave and master/master mysql setups. The following SQL commands have to be be executed in phpmyadmin or with the mysql commandline program. It is just important that you are logged in as mysql root user. Below I will use the mysql commandline client.

Login into mysql as root user from commandline:

mysql -u root -p

the mysql command will ask for the mysql root password.

Then execute these commands if the installed mysql version is < 5.5.16:


use the commands below instead if the mysql version is > 5.5.16


Now edit the my.cnf file (/etc/mysql/my.cnf) and add a # in front of all lines that start with "replicate-" or "master-". Example:

# replicate-same-server-id = 0
# master-host =
# master-user = slaveuser
# master-password = akst6Wqcz2B
# master-connect-retry = 60

Then restart mysql:

/etc/init.d/mysql restart


2 thoughts on “How to disable MySQL replication on master/master andmaster/slave setups”

  1. Hi fellow,

    thank you for the explanation, I want to know if analogue method can be used to re-insert the node in the cluster, the scenario is this:

    I want to be able to update a two-node application, without losing service,

    i.e. balancer will point to node-1 only, plug-off DB’s node-2 from cluster, then update code and DB on node -2, then the balancer should point to node-2 only, and then update node-1 code & DB, and then reinsert DB node-2 into master/master replication, and then balancer will see the both nodes.

    The question is, is this possible? of the changes made in one or other DB will make it un-syncable afetwards?

    Thanks in advance

  2. Hi,
    “When master delete a record , slave also delete done , But i dont delete in slave , Only delete master record ” how to give privileges “

    help me


Leave a Comment