0

On a mysql 5.7 master, the following command generates syntax error.

CHANGE REPLICATION FILTER REPLICATE_DO_DB = ('mydb')
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 'REPLICATION FILTER REPLICATE_DO_DB = ('mydb')' at line 1

I have tried it with or without single quote around database name. official guide

  • “Names of tables and database not containing any special characters need not be quoted”. – Philᵀᴹ Apr 28 at 8:50
  • @Philᵀᴹ I tried it with or without quote. – Tiina Apr 28 at 8:52
  • why are you running this on the master? – jerichorivera Apr 29 at 5:58
0

CHANGE REPLICATION FILTER REPLICATE-DO-DB is a SLAVE filter to read only (mydb) from the relay log.

If you want to filter the Master to write only (mydb) statements on the binary logs (and replicate only (mydb) to all slaves), you need to use the --binlog-do-db=name variable (Link) on master server.

0

The syntax error is pointing at the word REPLICATION, so the problem is there or immediately before there. It is not about quoting the db name.

This feature was added in 5.7; what version are you running?

This command applies only to Slaves.

This command cannot be used with Group Replication.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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