2016-10-04 57 views
0

我在我的ubuntu上運行了AMPPS並運行在/usr/local/ampps/目錄中。在ubuntu中運行的AMPPS終端中使用MongoDB

我想使用AMPPS中提供的MongoDB - 我已經從AMPPS控制面板啓動了MongoDB服務器。

,但我不能,我在/usr/local/ampps/mongodb/bin/目錄是使用它從終端,當我使用./mongo db mydb我得到:

MongoDB shell version: 3.2.0 
connecting to: use 
2016-10-04T09:29:04.921+0330 E -  [main] file [mydb] doesn't exist 
failed to load: mydb 

如何使用MongoDB的從終端?

FYI:我使用的MySQL,它是由AMPPS在終端這種方式運行:

cd /usr/local/ampps/mysql/bin/ 
./mysql -u root -p 

,我能夠用mysql從終端。

+0

同樣的事情在這裏,我該怎麼做? – anonymox

回答

0

我已經找到了如何做到這一點,在AMPPS夾,只是CD:

cd /usr/local/ampps/mongodb/bin 

然後運行:

./mongo 

你會得到這樣的事情:

MongoDB shell version: 3.2.0 
connecting to: test 
Welcome to the MongoDB shell. 
For interactive help, type "help". 
For more comprehensive documentation, see 
    http://docs.mongodb.org/ 
Questions? Try the support group 
    http://groups.google.com/group/mongodb-user 
Server has startup warnings: 
2016-10-04T09:08:12.567+0330 I CONTROL [main] ** WARNING: --rest is specified without --httpinterface, 
2016-10-04T09:08:12.567+0330 I CONTROL [main] **   enabling http interface 
2016-10-04T09:08:38.127+0330 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended. 
2016-10-04T09:08:38.127+0330 I CONTROL [initandlisten] 
2016-10-04T09:08:38.127+0330 I CONTROL [initandlisten] 
2016-10-04T09:08:38.127+0330 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. 
2016-10-04T09:08:38.127+0330 I CONTROL [initandlisten] **  We suggest setting it to 'never' 
2016-10-04T09:08:38.127+0330 I CONTROL [initandlisten] 
2016-10-04T09:08:38.127+0330 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. 
2016-10-04T09:08:38.127+0330 I CONTROL [initandlisten] **  We suggest setting it to 'never' 
2016-10-04T09:08:38.127+0330 I CONTROL [initandlisten] 
> 

正如你所看到的,你可以在>之前輸入你的命令,例如:

> show dbs 
admin 0.078GB 
local 0.078GB 
mydb 0.078GB 
>