How to reference a table called `\` (simply just backslash character) in MySQL in a query?
Somehow this query actually works...

RENAME TABLE `\` TO backslash; `;


Two statements, three backticks in total - neither statement would work by itself but somehow together they do the job. Despite giving an error.

To test this in a vacuum you can do:

mysql&gt; show tables;
Empty set (0.00 sec)

mysql&gt; CREATE TABLE `\` ( `foo` int(10) ) ENGINE=InnoDB CHARSET=utf8; `;
Query OK, 0 rows affected (0.00 sec)

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 '`' at line 1
mysql&gt; show tables;
+---------------+
| Tables_in_foo |
+---------------+
| \             |
+---------------+
1 row in set (0.00 sec)

mysql&gt; DROP TABLE `\`; `;
Query OK, 0 rows affected (0.00 sec)

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 '`' at line 1
mysql&gt; show tables;
Empty set (0.00 sec)


Please note that the syntax for this command is quite peculiar: it is the word "DROP" followed by "TABLE" followed by the string "\; `;" - that is backtick, then backslash, backtick again and then semi-colon. This is further followed by space, then (another) backtick and finally semi-colon.