Home » NoSQL » Neo4j » Create New neo4j Database in Linux

Create New neo4j Database in Linux

In Linux, starting and stopping Neo4J database are quite easy, as described in here. To start server you can execute this command :

./neo4j start

to stop server :

./neo4j stop

After start the server, we can operate a database located in $NEO_INSTALLATION/data/graph.db. Unfortunately, there is no command, something like ‘CREATE DATABASE’ in MySQL. In this post, I try to share my experience in creating new database in neo4j.  Neo4j saves its configuration in $NEO_INSTALLATION/conf. There are several configuration files such as neo4j.properties and neo4j-server.properties. Neo4j.properties is intended to save database ‘tuning’ configuration and neo4j-server.properties is for operational settings when neo4j server is run. And that’s it, neo4j-server.properties is what we will use to create a new database.

To create a new database, try these following steps :

  1. stop neo4j server (if it is on).
  2. open the neo4j-server.properties, using your favourite text editor.
  3. find the ‘key’, named org.neo4j.server.database.location. Edit the value to your ‘wannabe’ new database location. For example if your new database will be located in $NEO_INSTALLATION/data-test/graph-test.db, you should set the value to org.neo4j.server.database.location=data-test/graph-test.db . It is relative path to neo4j installation directory, and of course you can use absolute path. ( Note : at this step, only the directory data-test exist. The graph-test.db is not exist yet ).
  4. start neo4j server, wait for a second, and you will get your new neo4j database.
  5. Finish.

You can now play with your new database. 🙂

Leave a comment

Your email address will not be published. Required fields are marked *