DROP DATABASE 用于删除数据库。
drop_database_stmt:
DROP DATABASE [IF EXISTS] database_name;
参数 | 描述 |
---|---|
IF EXISTS | 用于防止当数据库不存在时发生错误。 |
database_name | 指定待删除的数据库名。 |
OceanBase(admin@test)>drop database test2;
Query OK, 0 rows affected (0.03 sec)
OceanBase(admin@test)>drop database notest;
ERROR 1008 (HY000): Can't drop database 'notest'; database doesn't exist
OceanBase(admin@test)>drop database if exists notest;
Query OK, 0 rows affected, 1 warning (0.00 sec)
OceanBase(admin@test)>show warnings;
+-------+------+------------------------------------------------------+
| Level | Code | Message |
+-------+------+------------------------------------------------------+
| Note | 1008 | Can't drop database 'notest'; database doesn't exist |
+-------+------+------------------------------------------------------+
1 row in set (0.00 sec)
备案信息: 粤ICP备15087711号-2
Copyright © 2008-2024 啊嘎哇在线工具箱 All Rights.
本站所有资料来源于网络,版权归原作者所有,仅作学习交流使用,如不慎侵犯了您的权利,请联系我们。