I am trying to drop a database having special characters (!`) in it.
MySQL [test]> show databases;
+-------------------------+
| Database |
+-------------------------+
| d1 |
| d2 |
| db1`; select 'oops!' |
MySQL [test]> drop database `db1\`\; select \'oops!\'`;
ERROR: Unknown command '\;'.
ERROR: Unknown command '\''.
ERROR: Unknown command '\''.
`> Ctrl-C -- exit!
Aborted
MySQL [test]> drop database "db1`; select 'oops!'";
ERROR 1064 (HY000): [33792] syntax error: syntax error near ""db1`; select 'oops!'""
LINE: drop database "db1`; select 'oops!'"
^
I tried escaping these characters but it is not deleting for me. Including double quotes throws syntax error. I tried MySQL 5.6/5.7.