英文:
Why is there a database named "test" when connecting MongoDB using Studio3T?
问题
我正在学习 MongoDB 并尝试使用 Atlas。我创建了一个远程集群,并尝试使用 MongoDB Compass 和 Studio 3T 连接它。然而,我注意到在使用 Studio 3T 连接后,左侧面板中出现了一个名为 "test" 的空数据库,位于 "admin" 和 "local" 数据库下方。它是从哪里来的?我该如何删除它?因为当我尝试删除这个数据库时,出现了以下错误:
Mongo 服务器错误(MongoCommandException):命令执行失败,错误代码为 8000(AtlasError):'user is not allowed to do action [dropDatabase] on [test.]',在服务器 ac-bkmhuxm-shard-00-02.w2nutv2.mongodb.net:27017 上。
完整的响应如下:
{
"ok" : 0.0,
"errmsg" : "user is not allowed to do action [dropDatabase] on [test.]",
"code" : 8000.0,
"codeName" : "AtlasError"
}
在 Atlas 中更改角色后,我现在可以删除这个数据库。然而,每当我建立新的与 MongoDB 的连接时,它仍然出现。为什么会这样?
英文:
I'm learning MongoDB and trying to use Atlas. I created a remote cluster and tried to connect it using both MongoDB Compass and Studio 3T. However, I noticed that after connecting with Studio 3T, there was an empty database named "test" appearing in the left panel, below "admin" and "local" databases. Where did it come from? And how can I drop it? Because when I tried to drop this database, I got this error
Mongo Server error (MongoCommandException): Command failed with error 8000 (AtlasError): 'user is not allowed to do action [dropDatabase] on [test.]' on server ac-bkmhuxm-shard-00-02.w2nutv2.mongodb.net:27017.
The full response is:
{
"ok" : 0.0,
"errmsg" : "user is not allowed to do action [dropDatabase] on [test.]",
"code" : 8000.0,
"codeName" : "AtlasError"
}
After changing the roles in Atlas, I can now delete the database. However it keeps appearing when I make a new connection to MongoDB. Why is that?
答案1
得分: 1
数据库 test
是默认数据库,当你没有定义任何内容时使用。
数据库 local
、admin
和 config
是MongoDB系统内部数据库,除非得到MongoDB支持或特殊管理员任务的建议,不应该操作它们。
另请参阅 MongoDB中的3个默认数据库。
英文:
Database test
is the default database when you don't define anything.
Databases local
, admin
and config
are MongoDB system internal databases, you should not touch them unless advised by MongoDB support or special admin tasks.
See also 3 default database in MongoDB
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论