OrientDB - List Database
本章讲解了如何从OrientDB命令行获取实例中所有数据库的列表。
以下语句是info命令的基本语法。
LIST DATABASES
注意 − 只有在连接到本地或远程服务器后才能使用此命令。
示例
在检索数据库列表之前,我们必须通过远程服务器连接到localhost服务器。需要提醒的是,连接到localhost实例的用户名和密码分别是guest和guest,在orintdb/config/orientdb-server-config.xml文件中配置。
您可以使用以下命令连接到localhost数据库服务器实例。
orientdb> connect remote:localhost 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/}>