gpt4 book ai didi

mysql - 在 ubuntu 中由 AMPPS 运行的终端中使用 MongoDB

转载 作者:行者123 更新时间:2023-11-29 20:14:59 24 4
gpt4 key购买 nike

我已经在我的 ubuntu 中启动并运行了 AMPPS,该 ubuntu 位于 /usr/local/ampps/ 目录中。

我想使用 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?

仅供引用:我使用了由 AMPPS 在终端中运行的 mysql:

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

我可以从终端使用 mysql。

最佳答案

我已经想出了如何做到这一点,只需将 cd 放入 AMPPS 文件夹即可:

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
>

关于mysql - 在 ubuntu 中由 AMPPS 运行的终端中使用 MongoDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39845157/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com