mongodb를 설치하면서 2개의 에러를 넘어 여기까지 왔는데.
mongod 까지도 괜찮았어.
그리고 이제 mongodb shell과 연결하기 위해 mongo라고 입력했는데.
exception: connect failed
연결실패?!!!!!
j맥북 $ mongo
MongoDB shell version v4.0.0
connecting to: mongodb://127.0.0.1:27017
2022-09-16T00:06:20.258+0900 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed
mongo 연결실패 해결방법
인텔맥이라면
mongod --config /usr/local/etc/mongod.conf --fork
M1이라면
mongod --config /opt/homebrew/etc/mongod.conf --fork
입력한다.
*M1인데도 해결이 안되시는 분은 인탤맥 코드를 가져다 썼을 때 해결이 된다는 분이 있습니다.
잘 해결되었다고 하네요.
j맥북 $ mongod --config /usr/local/etc/mongod.conf --fork
2022-09-16T00:24:58.732+0900 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
about to fork child process, waiting until server is ready for connections.
forked process: 63032
child process started successfully, parent exiting
하하하
다시 터미널에 mongo를 입력해본다.
Mongo shell과 연결완료~ 연결되면 MongoDB와 대화할 수 있게 된다.
j맥북$ mongo
MongoDB shell version v4.0.0
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 4.0.0
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
2022-09-16T00:24:59.703+0900 I CONTROL [initandlisten]
2022-09-16T00:24:59.704+0900 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2022-09-16T00:24:59.705+0900 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2022-09-16T00:24:59.705+0900 I CONTROL [initandlisten]
2022-09-16T00:24:59.706+0900 I CONTROL [initandlisten]
2022-09-16T00:24:59.707+0900 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
---
Enable MongoDB's free cloud-based monitoring service to collect and display
metrics about your deployment (disk utilization, CPU, operation statistics,
etc).
The monitoring data will be available on a MongoDB website with a unique
URL created for you. Anyone you share the URL with will also be able to
view this page. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.
To enable free monitoring, run the following command:
db.enableFreeMonitoring()
---
>
MongoDB안에서 help 라고 명령어를 입력하면 mongodb에게 입력할 수 있는 명령어와 설명을 보여준다.
show dbs는 데이터베이스를 보여준다. 컴퓨터에 따라서 아래 3개가 모두 있지 않을 수도 있으니 문제는 아니다.
MongoDB 안에서 명령어를 입력할 수 있었다면 MongoDB가 성공적으로 설치 완료된 것이다.
MongoDB 설치 앞 단계에서 만난 다른 오류들 해결하기
[에러해결] xcode-select: error: command line tools are already installed, use "Software Update" to install updates / Xcode
Mac에 MongoDB 설치하다 만난 에러 첫 번째. mac 에 MongDB 설치 첫 단계로 터미널에 아래 코드를 입력해야하는데 하자마자 에러가 떴다. xcode-select --install 에러의 내용은 다음과 같다. xcode-select: erro..
rootingforme.tistory.com
2022.09.15 - [IT/개발] - Error: homebrew-core is a shallow clone. 에러 MongoDB 설치 에러 해결하기.
Error: homebrew-core is a shallow clone. 에러 MongoDB 설치 에러 해결하기.
mac에 mongodb설치 도중 만난 에러. 에러 속에 답이 있다. 마지막줄 터미널에 코드 입력. Error: homebrew-core is a shallow clone. To `brew update`, first run: git -C /usr/local/Homebrew/Library/Taps/ho..
rootingforme.tistory.com
'IT > javascript' 카테고리의 다른 글
mongoose 몽구스 설치하고 DB연결하기. (유튜브 클론 6.8) (0) | 2022.09.19 |
---|---|
[macOS] MongoDB 설치하기 (유튜브 클론 6.7) (0) | 2022.09.16 |
[에러해결] xcode-select: error: command line tools are already installed, use "Software Update" to install updates / Xcode 업데이트 하는 방법 (0) | 2022.09.15 |
Error: homebrew-core is a shallow clone. 에러 MongoDB 설치 에러 해결하기. (0) | 2022.09.15 |
pug 설치 및 사용방법 / html 헬퍼, 뷰엔진 (노마드코더 유튜브 클론 5.1) (0) | 2022.09.13 |