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条答案
按热度按时间gev0vcfq1#
这取决于在模式名中使用“-”。
您可以用反引号或双引号引用标识符(如果您启用了ansi\u quotes sql\u模式),这样就可以使用