Posts

Showing posts from September, 2020

How to Change a MySQL Data Directory to a New Location on CentOS 7

Image
How to Change a MySQL Data Directory to a New Location on CentOS 7 Step 1 : Moving the MySQL Data Directory To prepare for moving MySQL’s data directory, let’s verify the current location by starting an interactive MySQL session using the administrative credentials. [root@localhost ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.20 MySQL Community Server (GPL) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select @@datadir; +-------------------+ | @@datadir         | +-------------------+ | /var/lib/mysql/ | +-------------------+ 1 row in set (0.00 sec) step.2. To ensure the integrity of the data, we’ll shut dow...

HOW TO SETUP MYSQL MASTER MASTER REPLICATION WITH GTID.

 ####################### HOW TO SETUP MYSQL MASTER MASTER REPLICATION WITH GTID. A global transaction identifier (GTID) is a unique identifier created and associated with each transaction committed on the server of origin (master).  This identifier is unique not only to the server on which it originated, but is unique across all servers in a given replication setup.  There is a 1-to-1 mapping between all transactions and all GTIDs.  A GTID is represented as a pair of coordinates, separated by a colon character (:), as shown here: GTID = source_id:transaction_idMySQL_gtid-master-master Advantages : ● Setting up MySQL replication is simple ● Consistency is guaranteed between master and slaves. ● Simple to determine inconsistency ● Fail-over process become much easier. step.1. Get Both server  serverA and serverB ip. serverA ip=xx.xx.xx.xx serverB ip=xx.xx.xx.xx Step 2 : Configure the Master serverA To enable GTID-based replication, each server must be started with...