如何使用字符'?'来删除数据库在它的名字?

时间:2021-01-06 11:14:36

Just trying out ubuntu server on my pc and have been testing some commands including mysql. I'm not sure why phpMyAdmin permitted me to create a database like this 'testing?db'. I'm trying to drop this database via SSH but I get this error:

只是在我的电脑上试用ubuntu服务器并且已经测试了一些命令,包括mysql。我不确定为什么phpMyAdmin允许我创建像'testing?db'这样的数据库。我试图通过SSH删除此数据库,但我收到此错误:

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 creating a database with a '?' in it and it also gives me syntax error. via ssh. so how do I remove this database?

我尝试使用'?'创建数据库在它,它也给我语法错误。通过ssh。那我该如何删除这个数据库?

1 个解决方案

#1


28  

Try:

尝试:

DROP DATABASE `testing?db`;

#1


28  

Try:

尝试:

DROP DATABASE `testing?db`;