How to secure MongoDB with username and password

You need to start mongod with the --auth option after setting up the user.

From the MongoDB Site:

Run the database (mongod process) with the --auth option to enable
security. You must either have added a user to the admin db before
starting the server with --auth, or add the first user from the
localhost interface.

MongoDB Authentication

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)