How to drop a database with a symbol ?? on his behalf?

Just try the ubuntu server on my computer and test some commands, including mysql. I'm not sure why phpMyAdmin allowed me to create a database such as "testing? Db". I am trying to delete this database via SSH, but I am getting this error:

mysql> show databases -> ; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | phpmyadmin | | testing?db | | testing_db | | wp | +--------------------+ 6 rows in set (0.00 sec) mysql> DROP DATABASE testing?db; 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 '?db' at line 1 mysql> 

I tried to create a database with '?' in it, and it also gives me a syntax error. through ssh. so how to delete this database?

+8
database mysql sql-drop
source share
1 answer

Try:

 DROP DATABASE `testing?db`; 
+26
source share

All Articles