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

4

1 回答 1

5

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

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

drop database `openvpn-admin`;
于 2018-04-18T04:15:21.310 回答