MariaDB - replica update
Updating the address of the primary/master host on the replication server
1) On master/primary host:
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
+--------------------+----------+----------------------------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+--------------------+----------+----------------------------------+------------------+
| master-bin.000119 | 343 | ghost,gitea,semaphore,photoprism | |
+--------------------+----------+----------------------------------+------------------+
2) On replica host:
SHOW SLAVE STATUS;
+----------------------------------+-------------+-------------------+---------------------+------------------+-------------------+
| Slave_IO_State | Master_Host | Master_Log_File | Read_Master_Log_Pos | Slave_IO_Running | Slave_SQL_Running |
+----------------------------------+-------------+-------------------+---------------------+------------------+-------------------+
| Waiting for master to send event | mariadb | master-bin.000119 | 343 | Yes | Yes |
+----------------------------------+-------------+-------------------+---------------------+------------------+-------------------+
STOP SLAVE;
CHANGE MASTER TO
MASTER_HOST='mariadb',
MASTER_USER='replication',
MASTER_PASSWORD='******************',
MASTER_PORT=3306,
MASTER_LOG_FILE='master-bin.000119',
MASTER_LOG_POS=343,
MASTER_CONNECT_RETRY=60;
CHANGE MASTER TO MASTER_USE_GTID = no;
START SLAVE;
SHOW SLAVE STATUS;
+----------------------------------+-------------+-------------------+---------------------+------------------+-------------------+
| Slave_IO_State | Master_Host | Master_Log_File | Read_Master_Log_Pos | Slave_IO_Running | Slave_SQL_Running |
+----------------------------------+-------------+-------------------+---------------------+------------------+-------------------+
| Waiting for master to send event | mariadb | master-bin.000119 | 343 | Yes | Yes |
+----------------------------------+-------------+-------------------+---------------------+------------------+-------------------+
Master host
UNLOCK TABLES;