Home / MySql / Switchover MySQL

Switchover MySQL

Switchover MySQL

 

Source 199
Replica 198

SOURCE

SET GLOBAL read_only=ON;

set global super_read_only=ON;

show variables like '%super%read%';

show variables like '%read_only%';

flush tables;
flush logs;

SHOW MASTER STATUS;

REPLICA

stop slave;

set global read_only=OFF;

set global super_read_only=OFF;

show variables like '%read_o%';

SHOW MASTER STATUS; -- TEST-SQL2-bin.000002 --2760785

create user 'rep_user'@'172.25.2.198' identified with mysql_native_password by 'CP@MySQL2023';

create user 'repcat'@'%' identified by 'CP@MySQL2023';

grant replication client, replication slave on *.* to 'repcat'@'%';
grant replication client, replication slave on *.* to 'rep_user'@'172.25.2.198';

rename user 'rep_user'@'172.25.2.198' to 'rep_user'@'%';

Flush privileges;

select * from mysql.user;

drop user 'rep_user'@'172.25.2.199';

drop user 'rep_user'@'%';

Source —> which is new Replica
change master to master_host=’172.25.2.198′ , master_user=’repcat’,master_password=’CP@MySQL2023′,master_log_file=’TEST-SQL1-bin.000001′,master_log_pos=5380 ;

 

  • 5

About Abdul Khalique Siddique

In addition to my proficiency in Oracle Database, I have also specialized in Oracle E-Business Suite. I have hands-on experience in implementing, configuring, and maintaining EBS applications, enabling organizations to streamline their business processes and achieve operational efficiency. Also I have hands-on experience in Oracle Cloud Infrastructure (OCI). I have worked with OCI services such as compute, storage, networking, and database offerings, leveraging the power of the cloud to deliver scalable and cost-effective solutions. My knowledge of OCI architecture and deployment models allows me to design and implement robust and secure cloud environments for various business requirements. Furthermore, I have specialized in disaster recovery solutions for Oracle technologies. I have designed and implemented comprehensive disaster recovery strategies, including backup and recovery procedures, standby databases, and high availability configurations. My expertise in data replication, failover mechanisms, and business continuity planning ensures that organizations can quickly recover from disruptions and maintain uninterrupted operations.

Check Also

Restarting MYSQL Instances and Servers

Restarting MYSQL Instances and Servers   Environment:- MySQL Database Instances running in two separate Windows …