本章介紹如何從OrientDB命令行獲取實例中所有資料庫的列表。
以下語句是list
命令的基本語法。
LIST DATABASES
注 - 只有在連接到本地或遠程伺服器後,才能使用此命令。
示例
在檢索資料庫列表之前,必須通過遠程伺服器連接到本地主機伺服器。 需要提醒的是,連接到本地主機實例的用戶名和密碼分別是guest
和guest
,它是在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凍結資料庫