▪ database_name - the name of the database that includes the authentication credentials of the created admin user.įor example, run mongo -host 10.10.7.161:27017 -u mongodb -p mongodb -authenticationDatabase admin. To install MongoDB (version 5.0) on WSL (Ubuntu 20.04): Open your WSL terminal (ie. ▪ password - the admin password used to log in to the MongoDB Server. ▪ username - the admin user name that you created to log in to the MongoDB Server. ▪ hostname - the IP address of the MongoDB Server and the port number that the MongoDB service uses. ▪ ssl mode - an option to set up the use of mixed SSL modes on a port.įor example, run mongo -host 192.168.33.76:27017 -u admin -p abc123 -authenticationDatabase admin -ssl -sslAllowInvalidCertificates. Mongo -host -u -p -authenticationDatabase -ssl. ![]() Run the following command at the command line to connect to the MongoDB Server: If you want to connect to a remote server, use the host option with the mongo command, as shown below. After successfully installing your MongoDB Server, you can establish a connection to verify its reachability. If your MongoDB server runs on a different port, you have to explicitly specify it in the command, as shown below: Copy mongo -port 28010 Remote server Both of the above commands only work if your MongoDB server is running on the localhost.
0 Comments
Leave a Reply. |