OrientDB列出資料庫

本章介紹如何從OrientDB命令行獲取實例中所有資料庫的列表。

以下語句是list命令的基本語法。

LIST DATABASES

注 - 只有在連接到本地或遠程伺服器後,才能使用此命令。

示例

在檢索資料庫列表之前,必須通過遠程伺服器連接到本地主機伺服器。 需要提醒的是,連接到本地主機實例的用戶名和密碼分別是guestguest,它是在orintdb/config/orientdb-server-config.xml檔中配置的。

可以使用以下命令連接到localhost資料庫伺服器實例。

orientdb> connect remote:localhost guest

它會詢問密碼。 根據guest的配置檔密碼也是guest。 如果連接成功,將獲得以下輸出。

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

連接到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/}>

上一篇: OrientDB資料庫資訊 下一篇: OrientDB凍結資料庫