MariaDB server version for the right syntax to use near 'FOR CHANNEL 'master1_test116'' at line 1

727 Views Asked by At
MariaDB [(none)]> CHANGE MASTER TO MASTER_HOST='192.168.56.116', MASTER_PORT=3306, MASTER_USER='replica1', MASTER_PASSWORD='pass@123', MASTER_LOG_FILE='mysql-bin.000002', MASTER_LOG_POS=327 FOR CHANNEL 'master1_test116';

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FOR CHANNEL 'master1_test116'' at line 1 MariaDB [(none)]>

Two mariadb masters having 10.1.48 and 1 slave 10.4.25

1

There are 1 best solutions below

4
Barmar On

From the documentation:

MariaDB starting with 10.7.0
The FOR CHANNEL keyword was added for MySQL compatibility. This is identical to using the channel_name directly after CHANGE MASTER.

So you should write

CHANGE MASTER 'master1_test116' TO MASTER_HOST='192.168.56.116', MASTER_PORT=3306, MASTER_USER='replica1', MASTER_PASSWORD='pass@123', MASTER_LOG_FILE='mysql-bin.000002', MASTER_LOG_POS=327;