l ๐Ÿค– ์ฝ”๋“œ l

[MongoDB] ๋ชฝ๊ณ ๋””๋น„ ์„ค์น˜/์‹œ์ž‘

์ฝ”๋“œ๊ทธ๋ฆผ 2020. 5. 28.
๋ฐ˜์‘ํ˜•

1. ๋ชฝ๊ณ DB ๋งํฌ ๋“ค์–ด๊ฐ€์„œ ์ž์‹ ์˜ os์— ๋งž๋Š” ๋ฒ„์ „์„ ๋‹ค์šด๋กœ๋“œ ํ•ฉ๋‹ˆ๋‹ค. 

https://www.mongodb.com/download-center/community

 

Download Center: Community Server

Download MongoDB Community Server, the most popular non-relational database built to address the needs of modern applications.

www.mongodb.com

 

์ €๋Š” ์••์ถ•๋ฐ›์•„ ๋‹ค์šด๋กœ๋“œํ•˜๊ณ  Cํด๋”์—์„œ ์••์ถœ์„ ํ’€์–ด๋’€์–ด์š”.

 

 

 

 

2. cmd์—์„œ ๋ชฝ๊ณ DB ์„ค์น˜ํด๋”๋กœ ๊ฐ€์…”์„œ md data ๋ช…๋ น์–ด๋กœ dataํด๋”๋ฅผ ๋งŒ๋“ค์–ด์ค๋‹ˆ๋‹ค.

๋ช…๋ น์–ด:  

-> cd ์„ค์น˜ํ•œํด๋”๊ฒฝ๋กœ

-> md data (md๊ฐ€ ํด๋” ๋งŒ๋“œ๋Š” ๋ช…๋ น์–ด์ž…๋‹ˆ๋‹ค.)

 

 

3. ๋ชฝ๊ณ DB ํด๋” ์•ˆ์˜ bin ํด๋”๋กœ ๊ฒฝ๋กœ๋ฅผ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค. (๋ช…๋ น์–ด: cd bin)

4. ๋ช…๋ ์–ด mongod --dbpath ๋ชฝ๊ณ db๋ฐ์ดํƒ€ํด๋” ๊ฒฝ๋กœ (๋ช…๋ น์–ด: mongod --dbpath C:\mongodb\data)

 

cmd ๋ฐ‘์œผ๋กœ ๋‚ด์šฉ์ด ์ขŒ์•„์•… ๋‚˜์˜ค๋ฉด ๋ชฝ๋„๋””๋น„๊ฐ€ ์‹คํ–‰๋œ๊ฑฐ์˜ˆ์š”.

 

--dbpath๋Š” ๋ฐ์ดํ„ฐ๊ฐ€ ์ €์žฅ๋  ์œ„์น˜๋ฅผ ๊ฐ€๋ฆฌํ‚ค๋Š” ๊ฒ๋‹ˆ๋‹ค.

 

์ด์ œ ๋ชฝ๊ณ DB๊ฐ€ localhost:27017์—์„œ ์‹คํ–‰์ค‘์ธ ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ์–ด์š”.

 

 

 

5. ๋ธŒ๋ผ์šฐ์ €์—์„œ localhost:27017๋กœ ์ ‘์†ํ•˜์—ฌ ์ ‘์†์ฐฝ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

 

 

 

6. ์ ‘์†ํ•œ cmd์ฐฝ์€ ๊ทธ๋Œ€๋กœ ๋‘๊ณ  ์ƒˆ๋กœ์šด cmd์ฐฝ์„ ์ผœ์ฃผ์„ธ์š”.

7. cd ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•˜์—ฌ mongoDB ํ•˜์œ„ bin ํด๋”๋กœ ์ด๋™ํ•ด์ฃผ์‹œ๊ณ  mongo๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.

 

 

 

8. connecting to: test๋ฅผ ์ž…๋ ฅํ•˜๋ฉด test๋””๋น„๋กœ ์—ฐ๊ฒฐ๋ฉ๋‹ˆ๋‹ค.

์ด์ œ ์ฟผ๋ฆฌ๋ฅผ ์น˜๊ธฐ ์‹œ์ž‘ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹น~~~

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€

๐Ÿ’ฒ ์ถ”์ฒœ ๊ธ€