mongodb data can be displayed in the client, but does not work in the command line linux

mongodb data can be displayed in the client, but the reason does not work linux command line is turned mongodb user name and password authentication, if authentication is turned on, the connection is required using the following method:

1. When a client connects, specify a user name, password, db name

mongo --port 27017 -u user name -p password --authenticationDatabase "admin"

2. After the client is connected, and then verified. 1 shows the output verification is successful. Then you can execute other commands

Published 11 original articles · won praise 0 · Views 119

Guess you like

Origin blog.csdn.net/qq_34172780/article/details/104826240