为什么我不能删除数据库?

h4cxqtbf  于 2021-06-25  发布在  Mysql
关注(0)|答案(1)|浏览(466)
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| admin_default      |
| information_schema |
| mysql              |
| openvpn-admin      |
| performance_schema |
| roundcube          |
+--------------------+
6 rows in set (0.00 sec)

MariaDB [(none)]> drop database 'openvpn-admin';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''openvpn-admin'' at line 1
MariaDB [(none)]> drop database openvpn-admin;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-admin' at line 1
MariaDB [(none)]>

我被触发了。mariadb+vestacp我不能删除数据库为什么?怎么了???

gev0vcfq

gev0vcfq1#

这取决于在模式名中使用“-”。
您可以用反引号或双引号引用标识符(如果您启用了ansi\u quotes sql\u模式),这样就可以使用

drop database `openvpn-admin`;

相关问题