Linked Questions

1 vote
1 answer
707 views

Cannot connect to MongoDB when I specify database name [duplicate]

I run MongoDB docker container on my local computer and when I try to connect to MongoDB container without specifying database name, it works fine. With following command, I managed to connect to ...
Tatsuki Monji's user avatar
0 votes
2 answers
53 views

mongoDB - can't connect when db name specified [duplicate]

I can't connect to mongoDB started in a container when database path is specified. I use mongoDB Compass to test connection - it returns Authentication failed. The container with mongo is started via ...
pj43's user avatar
  • 55
1 vote
1 answer
37 views

Mongodb AuthenticationFailed while connecting via docker [duplicate]

version: '3.8' services: mongodb: image: mongo container_name: mongodb-server environment: - MONGO_INITDB_ROOT_USERNAME=athul - MONGO_INITDB_ROOT_PASSWORD=athul volumes:...
ATHUL SURESH's user avatar
0 votes
0 answers
25 views

MongoDB adding `test` database while execution [duplicate]

I'm trying to figure out why my MongoDB connection is not connecting me to a particular database. My connection string is mongodb://localhost:27017/ Meanwhile, I'm trying to execute the script somehow ...
Daniil Sinelnik's user avatar
0 votes
0 answers
14 views

Authentification failed when mongodump [duplicate]

I am trying to dump a MongoDB database on my local machine, so I used this command according to mongodb documentation : mongodump --uri="mongodb://username:[email protected]:27017" ...
Sophia BOUKAIBA's user avatar
945 votes
21 answers
542k views

How do I drop a MongoDB database from the command line?

What's the easiest way to do this from my bash prompt?
coffee-grinder's user avatar
30 votes
23 answers
97k views

Mongodb + Atlas: 'bad auth Authentication failed.', code: 8000,

I've tried this and it's not working. I have the following error with Mongodb + Atlas: MongoError: bad auth Authentication failed. at /Users/cyrus/Documents/Code/01. Code/Franklin-ford/franklin-...
cyruslk's user avatar
  • 869
28 votes
15 answers
46k views

Mongoose connection authentication failed

With this help, I created a super user in the mongo shell: Create Superuser in mongo user: "try1" passw: "hello" In mongo cmd, I have 3 databases: 'admin', 'myDatabase' and 'local'. Now I try to use ...
Tichel's user avatar
  • 531
10 votes
8 answers
29k views

Why am I unable to connect to MongoDB using NestJS and Mongoose?

I have a nest.js node server and I am trying to connect mongoDB data base in the app.module, when the connection string doesn't contains the DB name - the connection to default DB "test" ...
user2436448's user avatar
10 votes
2 answers
3k views

Mongoose connection error when using db name in connection string

When I try to connect to Mongo instance using this connection string mongodb://root:password@localhost:27017/ everything works, however, when I try to specify the database name in the connection ...
eugenekgn's user avatar
  • 1,722
2 votes
3 answers
26k views

How to connect directly to a database with mongosh

I'm having connection problems with my local mongodb instance. Its not that it is not working, but there are some things that don't work, which I expected to work. In my case I'm trying to setup my ...
Jeanluca Scaljeri's user avatar
2 votes
1 answer
3k views

MongoError: Authentication failed with docker-compose

I am trying to build this app https://github.com/dwgebler/node-express-example. I want to use it as a template for making a Mongodb http express server. I tried to build the docker compose file in ...
ChristianOConnor's user avatar
2 votes
1 answer
7k views

grantRolesToUser fails with error "Could not find role: root"

Using mongosh in mongo compass, I've created a user for my database: use test_db db.createUser({user:'some_user', pwd: 'some_pass', roles:[]}) Now, when I try to assign root role to it, I get could ...
Web Jigooli's user avatar
0 votes
2 answers
8k views

Authentication failed connecting to MongoDB running in a local docker cointainer from Spring Boot application

I cannot connect to a mongodb instance running in a local docker container from my spring boot application. When the application tries to connect to the database the error below is thrown: 2022-04-03 ...
eHayik's user avatar
  • 3,302
0 votes
1 answer
4k views

Error authentication to MongoDB - Exception authenticating MongoCredential

Just working locally on a Windows machine, with a Java Spring Boot 3.1.0 app and a latest mongo db version, and getting failure when connecting the app with database. The db is deployed locally with ...
arevilla009's user avatar

15 30 50 per page
1
2 3 4 5
8