Orientdb 简明教程

OrientDB - Drop Database

类似于 RDBMS,OrientDB 提供了删除数据库的功能。 Drop database 指的是彻底删除一个数据库。

Similar to RDBMS, OrientDB provides the feature to drop a database. Drop database refers to removing a database completely.

下列陈述是删除数据库命令的基本语法。

The following statement is the basic syntax of the Drop database command.

DROP DATABASE [<database-name> <server-username> <server-user-password>]

以下是上文中选项的详细信息。

Following are the details about the options in the above syntax.

<database-name> − 您想要删除的数据库名称。

<database-name> − Database name you want to drop.

<server-username> − 拥有删除数据库权限的数据库的用户名。

<server-username> − Username of the database who has the privilege to drop a database.

<server-user-password> − 指定用户的密码。

<server-user-password> − Password of the particular user.

Example

有两种删除数据库的方法,一种是删除当前已打开的数据库,另一种是通过提供特定名称来删除特定数据库。

There are two ways to drop a database, one is drop a currently open database and second is drop a particular database by providing the particular name.

在此示例中,我们将使用此前章节中创建的同名数据库“demo”。您可以使用以下命令来删除数据库 demo

In this example, we will use the same database named ‘demo’ that we created in an earlier chapter. You can use the following command to drop a database demo.

orientdb {db = demo}> DROP DATABASE

如果这个命令成功执行,您将得到以下输出。

If this command is successfully executed, you will get the following output.

Database 'demo' deleted successfully

OR

您可以使用另一个命令来删除数据库,如下所示。

You can use another command to drop a database as follows.

orientdb> DROP DATABASE PLOCAL:/opt/orientdb/databases/demo admin admin

如果这个命令成功执行,您将得到以下输出。

If this command is successfully executed, you will get the following output.

Database 'demo' deleted successfully