Memgraph 시작하기 — Docker 로 띄우고 첫 질의

Memgraph 시작하기

Docker 환경에서 Memgraph 를 띄우고 데이터를 넣어 첫 Cypher 질의를 실행합니다.

출처: Getting started with Memgraph — 공식문서

Memgraph Platform 설치

새 사용자라면 Memgraph Platform(DB + MAGE + Memgraph Lab)을 빠르게 체험하는 것을 권장합니다.

# Docker 실행 중인지 확인 후
curl https://install.memgraph.com | sh

이 스크립트는 Docker Compose 파일을 받아 memgraph-magememgraph-lab 두 컨테이너를 각각 띄웁니다. 관리는 docker compose start/stop/down/restart 로 합니다.

연결

mgconsole CLI 로 연결합니다.

docker run -it memgraph/mgconsole:latest [--host HOST_IP] [--port PORT]

또는 Memgraph Lab 웹 앱(localhost:3000)이나 데스크톱 앱으로 연결합니다.

데이터 import

CSV·JSON 과 CYPHERL 파일의 쿼리 등 여러 형식을 지원하며, 20개 이상의 사전 제작 데이터셋을 Load dataset 으로 불러와 실습할 수 있습니다.

첫 Cypher 질의

Query Execution 에서 다음을 실행해 모든 노드·관계를 봅니다.

MATCH (n)-[r]-(m)
RETURN n, r, m;

고급 알고리즘

CALL pagerank.get()
YIELD node, rank;

더 알아보기