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.