mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-05 05:12:45 +08:00
13 lines
327 B
Bash
Executable File
13 lines
327 B
Bash
Executable File
mongo -- "$MONGO_INITDB_DATABASE" <<EOF
|
|
db = db.getSiblingDB('admin')
|
|
db.auth('$MONGO_INITDB_ROOT_USERNAME', '$MONGO_INITDB_ROOT_PASSWORD')
|
|
db = db.getSiblingDB('$MONGO_INITDB_DATABASE')
|
|
db.createUser({
|
|
user: "$MONGO_USERNAME",
|
|
pwd: "$MONGO_PASSWORD",
|
|
roles: [
|
|
{ role: 'root', db: '$MONGO_INITDB_DATABASE' }
|
|
]
|
|
})
|
|
EOF
|