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`
- SVN Update Error Please execute the ‘Cleanup‘ command [How to Solve]
- [Solved] C# Access Mongodb Database Error: command find failed: Command find requires authentication
- [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:
- Nexus3 builds Jenkins error: Not authorized (Downloading dependent jar package error)
- [Solved] Mac Install mongodb error: NonExistentPath: Data directory /data/db not found.
- Mongodb error: authentication failed [How to Solve]
- Vs code execute command error [How to Solve]
- [Solved] mongodb Startup Error: ERROR: child process failed, exited with error number 14
- Windows update failed to update, indicating the solution of 0x80244021
- Robo3T Remote Connect MongoDB Error: Failed to refresh ‘Collections‘. Error: ListCollections failed
- [Solved] MongoDB Error: TypeError: Object of type ObjectId is not JSON serializable
- MAC-XXL_JOB Error: Failed to create parent directories for [/data/applogs/xxl-job/xxl-job-admin.log
- Mongodb Crash Error: Too many open files [How to Solve]
- How to Solve SpringBoot MongoDB MongoAutoConfiguration Startup Error
- Apache Altas Compile Error: [ERROR] Failed to execute goal on project atlas-testtools: Could not resolve
- How to Solve Error: Android java.lang.IllegalStateException: Could not execute method of the activity
- [Solved] Hive execute insert overwrite error: could not be cleared up
- Attributeerror encountered when using ceilometer and gnocchi to execute commands related to gnocchi metric list: _Environ instance has no attribute ‘