1. 程式人生 > >mongodb ssh 登入

mongodb ssh 登入

首先,遠端登入ip:

ssh root@ip
例如:
ssh root@10.0.0.1

其次,使用命令登入mongo:

mongo -uxxxxx -pxxxxx --authenticationDatabase admin

第三,展示資料庫:

show dbs

第四,使用特定資料庫:

use admin

第五,展示所有表:

show collections

第六,展示出特定表內容:

db.xxxxxx.find()
例如:db.Names_result.find()