#create volume mongo-auth
docker create volume --name mongo-auth
#Start Container id with option --auth:
docker run -d --name mongo_auth -p 27017:27017 -v mongo-auth:/data/db mongo --auth
docker exec -it container_id mongo admin
#Add administrator user for "admin" database
db.createUser({ user: 'admin', pwd: 'password', roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] });
#Logout and Login Again with user/password
docker exec -it container_id mongo -u username databasename
ex.
docker exec -it container_id mongo -u admin admin
#Create News Database
use NEWDB
#Add AD admin user for "NEWDB" database
db.createUser({ user: 'app', pwd: 'password', roles: ["readWrite", "dbAdmin"] });
#Login New Mongo DB with user Authentication
docker exec -it Container_ID mongo -u database_username DatabaseName
ex.
docker exec -it Container_ID mongo -u app NEWDB
Subscribe to:
Post Comments (Atom)
ALCATEL 6900
write memory copy running certified reload from working no rollback-timeout
-
grant execute on utl_http to wc grant execute on dbms_lock to wc; BEGIN DBMS_NETWORK_ACL_ADMIN.create_acl ( acl => &...
-
:system view system-view or sys :show all config dis current-configuration :create vlan vlan vlan_number :show ip interface ...
-
``` sda: add missing path sda: failed to get udev uid: Invalid argument sda: failed to get sysfs uid: Invalid argument sda: failed to ge...
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.