How to delete/create databases in Neo4j?

Creating new Database in Neo4j

Before Starting neo4j community click the browse option

enter image description here

and choose a different directory

enter image description here

enter image description here

and click start button.

enter image description here

New database created on that direcory


You can just remove the entire graph directory with rm -rf, because Neo4j is not storing anything outside that:

rm -rf data/*

Also, you can of course iterate through all nodes and delete their relationships and the nodes themselves, but that might be too costly just for testing ...


From Neo4j 2.3,

We can delete all nodes with relationships,

MATCH (n)
DETACH DELETE n

Currently there is no any option to create multiple databases in Noe4j. You need to make multiple stores of Neo4j data. See reference.


even more simple command to delete all nodes and relationships:

MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n,r