How to start a mongodb shell in docker container?

You can run the interactive mongo shell by running the following command:

docker run -it -p 28000:27017 --name mongoContainer mongo:latest mongo

Otherwise, if your container is already running, you can use the exec command:

docker exec -it mongoContainer mongo

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)