OrientDB - 数据库列表



本章解释如何从 OrientDB 命令行获取实例中所有数据库的列表。

以下语句是 info 命令的基本语法。

LIST DATABASES

注意 - 只有在连接到本地或远程服务器后才能使用此命令。

示例

在检索数据库列表之前,我们必须通过远程服务器连接到本地主机服务器。需要提醒的是,连接到本地主机实例的用户名和密码分别是 guest 和 guest,这在orintdb/config/orientdb-server-config.xml文件中配置。

您可以使用以下命令连接到本地主机数据库服务器实例。

orientdb> connect remote:localhost guest 

它将询问密码。根据配置文件,guest 的密码也是 guest。如果成功连接,您将获得以下输出。

Connecting to remote Server instance [remote:localhost] with user 'guest'...OK 
orientdb {server = remote:localhost/}>

连接到本地主机数据库服务器后,您可以使用以下命令列出数据库。

orientdb {server = remote:localhost/}> list databases

如果成功执行,您将获得以下输出:

Found 6 databases: 
* demo (plocal) 
* s2 (plocal) 
* s1 (plocal) 
* GratefulDeadConcerts (plocal) 
* s3 (plocal) 
* sample (plocal) 
orientdb {server = remote:localhost/}>
广告
© . All rights reserved.