为什么我无法删除数据库?

时间:2018-04-17 22:43:32

标签: mysql database mariadb root vesta

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 我无法删除数据库为什么? 发生了什么事???

1 个答案:

答案 0 :(得分:1)

这取决于您在架构名称中使用“ - ”。

您使用反引号`或双引号引用标识符“(如果您启用了ANSI_QUOTES sql_mode),那么它将与

一起使用
drop database `openvpn-admin`;