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:

STOP SLAVE;
RESET SLAVE;
QUIT

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

STOP SLAVE;
RESET SLAVE ALL;
QUIT

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 = 192.168.0.105
# master-user = slaveuser
# master-password = akst6Wqcz2B
# master-connect-retry = 60

Then restart mysql:

/etc/init.d/mysql restart

 

Facebooktwittergoogle_plusredditlinkedinmail
Tagged on:     

One thought on “How to disable MySQL replication on master/master andmaster/slave setups

  • November 6, 2016 at 6:25 pm
    Permalink

    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

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *