gpt4 book ai didi

mysql - 如何删除名称中包含字符 '?' 的数据库?

转载 作者:IT王子 更新时间:2023-10-28 23:45:25 26 4
gpt4 key购买 nike

刚刚在我的电脑上试用了 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>

我尝试使用“?”创建数据库在其中,它也给了我语法错误。通过 ssh。那么如何删除这个数据库呢?

最佳答案

试试:

DROP DATABASE `testing?db`;

关于mysql - 如何删除名称中包含字符 '?' 的数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5446965/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com