Quantcast
Channel: MySQL Forums - Replication
Viewing all articles
Browse latest Browse all 1561

changing root@hostname password in master/slave replication setup (1 reply)

$
0
0
Hi,

I am trying to find as what are the best practises for changing root password in a master/slave replication. Since the entries for root@localhost & root@::1 @ root@127.0.0.1 will be there on both master and slave, it doesn't error out but for entries with hostnames like root@masterhostname, since that entry does not exist on slave, replication is going to throw an error.

Example:

MasterHost: nycnode1
SlaveHost : sfonode1

In the user@mysql table on MasterHost, i have entries for root@nycnode1 and i have setup the slave for this on sfonode1 by taking a MEB backup of the nycnode1. Before starting the replication, i changed the entries of root@nycnode1 on SLAVE server to root@sfonode by executing "update user set host='sfonode1' where user='root' and host='nycnode' and flush privileges. THen i started the replication using "change master to".

After the replication has been running for a month, i want to change the passwords for root user, if i change the password for root@nycnode1, since there is no entry on SLAVE, the Slave SQL thread is going to error out, my question is how do we go about changing the password in such situations?

If we stop the replication and change password and re-enable the replication, it is going to error as well since this statement is in the binary logs. If we reset the replication, then we might loose the replication data for the interval we are performing the password change. Taking a downtime to change password doesn't sound appealing.

Is "SET sql_log_bin = 0;" and then changing the password in that session the best way to do this? The only statement executed in this session would be the password change, so there is no data loss.

Thanks in advance for your thoughts.

Thanks,
Shiva

Viewing all articles
Browse latest Browse all 1561

Trending Articles