MongoDB Update User Error: Error: not authorized on admin to execute command
background
The thing is this: MongoDB weak password vulnerability and high risk, the password must be changed!
Environment: windows, the database is open authentication
report errors
Log in to the database and execute:
use admin
db.changeUserPassword('admin','123456');
report errors:
[Error] Error: not authorized on admin to execute command
Solution:
1. Close mongodb service (Windows service, registered)
2. Start the service without identity authentication:
mongod --dbpath=dbpath
3. Open new CMD
mongo
use admin
db.changeUserPassword('admin','123456');
Normal
4. Restart mongodb service
Read More:
- [Solved] mongodb Backup Error: Failed: error getting collections for database `admin`: error running `listCollections`
- Mongodb error: authentication failed [How to Solve]
- [Solved] Springboot Connect MongoDB Error: UncategorizedMongoDbException: Command failed with error 13 (Unauthorized)
- [Solved] MongoDB Error: FaileError: dToParse: Password must be URL Encoded for mongodb:// URL:
- EsgynDB Troubleshooting-ERROR[8837] Internal error occurred.
- Mongodb Crash Error: Too many open files [How to Solve]
- Robo3T Remote Connect MongoDB Error: Failed to refresh ‘Collections‘. Error: ListCollections failed
- UnknownHostException error when connecting to Mongo cluster Java
- How to Fix PVE Issues: ERROR: migration aborted
- Mysql5.7.18.1 Error 1054 (42S22): Unknown Column’password’ In’field List’ When Changing User Password
- [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]
- [Solved] Error: ER_ACCESS_DENIED_ERROR: Access denied for user ‘root’@‘localhost’ (using password: YES)
- Attributeerror encountered when using ceilometer and gnocchi to execute commands related to gnocchi metric list: _Environ instance has no attribute ‘
- How to Solve Rabbitmq Error: Failed to start RabbitMQ broker
- [Solved] mongodb Startup Error: ERROR: child process failed, exited with error number 14
- [Solved] C# Access Mongodb Database Error: command find failed: Command find requires authentication
- [Solved] panic: runtime error: invalid memory address or nil pointer dereference
- 2021-05-04T23:26:32.208+0800 E QUERY [js] Error: listDatabases failed:{ “ok“ : 0,
- Cli Write Error: This is related to npm not being able to find a file. [Solved]