Database Reference
In-Depth Information
A local Neo4j database —Connect by pointing the shell to the directory where the
Neo4j data is stored.
A remote Neo4j server over RMI —Connect by providing the shell with the host
name and port to connect to.
The Neo4j Shell start script is located in the $NEO4j_HOME/bin/directory, where
$NEO4J_HOME is the directory where Neo4j binaries are installed.
Table 6.2 illustrates how to connect to a local or remote Neo4j instance on both Linux-
based and Windows systems.
Table 6.2. Neo4j Shell startup script syntax for Linux and Windows environments
Database type
Linux command
Windows command
Local Neo4j data-
base
$NEO4J_HOME/bin/neo4j-shell-path=/var/
neo4j/db
$NEO4J_HOME/bin/neo4j-shell.bat-path=/var/
neo4j/db
Remote Neo4j
database
$NEO4J_HOME/bin/neo4j-
shell-host=localhost-port=1337
$NEO4J_HOME/bin/neo4j-
shell.bat-host=localhost port=1337
Before you start running queries, you need to populate the graph database. For this ex-
ample,we'regoingtousethesamedatasetfrom chapters 3 and 4 (socialnetworkofmovie
lovers). The location of database files on disk we used is /var/neo4j/db because we used a
Linux-based system, but you can replace it with the directory of your choice based on your
OS (for example, c:\neo4j\db on Windows).
Connect to the Neo4j database using the Neo4j Shell by running the following command
from the $NEO4J_HOME/bin directory:
neo4j-shell -path=/var/neo4j/db (Linux)
neo4j-shell.bat -path=/var/neo4j/db (Windows)
After you press Enter, you should be inside the Neo4j Shell, as illustrated in figure 6.2 ,
ready to run commands.
 
Search WWH ::




Custom Search