0

This is the MYSQL query:

CHANGE REPLICATION SOURCE TO SOURCE_HOST='3.94.185.28', SOURCE_USER='replica_user', SOURCE_PASSWORD='password', SOURCE_LOG_FILE='mysql-bin.000001', SOURCE_L
OG_POS=154
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SOURCE TO SOURCE_HOST='3.94.185.28', SOURCE_USER='replica_user', SOURCE_PASSWORD' at line 1

I'm MySQL 5.7.40

I also get a syntax error whenever i type any code containing REPLICA for example, STOP REPLICA;

1 Answer 1

0

It seems that you are using MySQL 8.0 syntax on MySQL 5.7 environment.

CHANGE REPLICATION SOURCE TO is first introduced on MySQL 8.0.23

In MySQL 5.7 the following syntax applies

CHANGE MASTER TO
  MASTER_HOST='source2.example.com',
  MASTER_USER='replication',
  MASTER_PASSWORD='password',
  MASTER_PORT=3306,
  MASTER_LOG_FILE='source2-bin.001',
  MASTER_LOG_POS=4,
  MASTER_CONNECT_RETRY=10;

I also get a syntax error whenever i type any code containing REPLICA for example, STOP REPLICA;

From MySQL 8.0.22, STOP SLAVE is deprecated and the alias STOP REPLICA should be used instead.

STOP SLAVE 8.0

STOP SLAVE 5.7

1
  • Wonderful. It worked. Thank you very much Jan 12 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.