MySQL 8.0: Escape Character in my.cnf - Database with # in the Name

by hpaknia   Last Updated October 10, 2019 00:06 AM - source

I have a database named #text#.xx which I need to ignore in replication. According to mysql:

The rules for escape sequences in option files differ slightly from the rules for escape sequences in string literals in SQL statements. In the latter context, if “x” is not a valid escape sequence character, \x becomes “x” rather than \x.

So I set my my.cnf to:

binlog-ignore-db     = test
binlog-ignore-db     = "#"text"#".xx
replicate-ignore-db  = "#"text#.ssh

But interestingly after restarting mysql I observe: mysql> show master status;

... Binlog_Ignore_DB
... test,"#"text"#".xx

The expectation is to see the Binlog_Ignore_DB equal to test,#text#.xx. Should I be concerned?

By the way

  1. f I don't escape at all I get test, (# comments out the rest of the line)
  2. If I escape with \, again anything after # will be commented out.
  3. Also I noticed the documentation is using and , but they definitely mean ".
Tags : mysql

Related Questions

The equivalent of CTE in MySQL from Microsoft SQL

Updated November 15, 2016 08:02 AM

getting innodb buffer usage

Updated August 24, 2018 15:06 PM