-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access secure mongo db #2
Comments
@arjundevrana Please use the username & password in the connection uri like this - spring.data.mongodb.uri=mongodb://useradmin:root@localhost:27017/admin I've tried this and it's working.
|
If you want to use username and password properties then make sure that you set host, port and database properties as well like this - spring.data.mongodb.host=localhost # This is the deault
spring.data.mongodb.port=27017 # This is the default
spring.data.mongodb.username=useradmin
spring.data.mongodb.password=root
spring.data.mongodb.database=admin Cheers, |
Thanks sir it is working |
My mongo data base like
mongo --port 27017 -u "useradmin" -p "root" --authenticationDatabase "admin"
and i set my properties like this
spring.data.mongodb.uri=mongodb://localhost:27017/admin
spring.data.mongodb.username= useradmin
spring.data.mongodb.password= root
But i am not connect connection can you solve it...
The text was updated successfully, but these errors were encountered: