Backup Command:
# mongodump -h 127.0.0.1:27229 -u root -p pw123456 –authenticationDatabase admin -o /data/backup/mongoDB |
Error Messages:
Failed: error getting collections for database `admin`: error running `listCollections`. Database: `admin` Err: not authorized on admin to execute command { lcursor: {}, $readPreference: { mode: “secondaryPreferred” }, $db: “admin” } |
Solution:
> use admin
> db.auth("root","pw123456")
> db.grantRolesToUser ( "root", [ { role: "__system", db: "admin" } ] ) #Grant the admin user permission to execute commands on the system.version table
Read More:
- How to Fix PVE Issues: ERROR: migration aborted
- [Solved] MongoDB Update User Error: Error: not authorized on admin to execute command
- DM backup database Error: [-7169]:bakres failed to communicate with DMAP message.
- [Solved] Ubuntu 20.04 LTS Install k8s Error: The connection to the server localhost:8080 was refused
- DB::Exception: test: Authentication failed: [How to Solve]
- SVN ERROR (E200033): database is locked [How to Solve]
- Attributeerror encountered when using ceilometer and gnocchi to execute commands related to gnocchi metric list: _Environ instance has no attribute ‘
- Creating test database for alias ‘postgres’… Got an error creating the test database: permission
- CDH oozie SSH error [How to Solve]
- [Solved] Oracle Delete the Archive Error: RMAN-08137
- [Solved] Docker Error: got permission denied while trying to connect to the docker daemon socket at…
- How to Solve Error: cannot open .Git/fetch_HEAD: Permission denied
- Rabbitmq: Erlang distribution failed solution
- [Solved] ERROR: Attempting to operate on hdfs journalnode as rootERROR: but there is no HDFS_JOURNALNODE_USE
- android remount of /system failed: Read-only file system [How to Solve]
- Mysql5.7.18.1 Error 1054 (42S22): Unknown Column’password’ In’field List’ When Changing User Password
- Mongodb error: authentication failed [How to Solve]
- [Solved] PostgreSQL Error: ERROR: CURRENT TRANSACTION IS ABORTED, COMMANDS IGNORED UNTIL END OF TRANSA
- How to Solve elasticsearch root user start Error
- [Solved] Error: ER_ACCESS_DENIED_ERROR: Access denied for user ‘root’@‘localhost’ (using password: YES)