为什么我不能删除数据库?
Why i cannot remove database?
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
我不能删除数据库为什么?
发生了什么事???
这取决于您在架构名称中使用“-”。
你用反引号 ` 或双引号 " 引用标识符(如果你启用了 ANSI_QUOTES sql_mode)所以它将与
一起使用
drop database `openvpn-admin`;
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 我不能删除数据库为什么? 发生了什么事???
这取决于您在架构名称中使用“-”。
你用反引号 ` 或双引号 " 引用标识符(如果你启用了 ANSI_QUOTES sql_mode)所以它将与
一起使用drop database `openvpn-admin`;