How to Fix the MongoDB "The domain, username and/or password are incorrect" Error ?


πŸ‘€Β Diwas Poudel Β Β  πŸ•’ 13 Aug 2023 Β Β  πŸ“ FIX

This error "The domain, username, and/or password are incorrect" is common when you are trying to install MongoDB as a service on Windows, Mac, and Linux. Some of the few reasons for this are :

  1. You have provided the wrong domain username and password.
  2. MongoDB Service is not running
  3. Mongodb configuration files are corrupted or incorrectΒ 

The primary issue most users are encountering is the first one.

So, let's look at how to fix it.

I am currently in the process of installing MongoDB 6.0 on a Windows OS. After that, I proceed to select the local service option. In this scenario, I choose the second option and attempt to move forward by clicking 'Submit.' However, I encounter an issue at this stage.

The error lies in not using the computer's username for the username field and the computer's password for the password field.

How to get a computer username?

For this open the command prompt and type :

echo %username%

and press Enter. This will provide you username. Just use this username in the Account name and use your computer password in the password field under Account Password. And in the domain just keep "." as you are using the local computer. Then click on Submit button.

username
fig. getting computer username

If you are using Linux or Mac you can use the following command to check the computer username

whoami

FAQ:

What is MongoDB as a Service(MongoDBaaS)?

This means that MongoDB will automatically run at startup and will keep running in the background.

What is the domain and username in Mongodb?

The domain refers to the network's name to which the user belongs to, whereas the username pertains to the user account's name.