As a Neo4j Aura customer, you may not have installed Neo4j anywhere since you are utilizing our cloud product. This makes complete sense, but if you want to utilize the cypher-shell tool, you need to install it. This article shows you how to install Neo4j on linux so you can have access to cypher-shell. (Note: you can also download cypher-shell at https://neo4j.com/download-center/#cypher-shell)
Find or create an instance, machine with Ubuntu (or similar linux) installed. Then execute these commands to add the neotechnology repository and install Neo4j (including cypher-shell):
$ wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
$ echo 'deb https://debian.neo4j.com stable latest' | sudo tee -a /etc/apt/sources.list.d/neo4j.list;sudo add-apt-repository -y ppa:openjdk-r/ppa;
$ sudo apt-get update;
$ sudo apt-get install neo4j -y;
$ sudo systemctl enable neo4j.service;
$ sudo systemctl start neo4j.service;
Now you have Neo4j installed, including cypher-shell:
cypher-shell -h
usage: cypher-shell [-h] [-a ADDRESS] [-u USERNAME] [--impersonate IMPERSONATE] [-p PASSWORD] [--encryption {true,false,default}] [-d DATABASE] [--format {auto,verbose,plain}] [-P PARAM] [--non-interactive] [--sample-rows SAMPLE-ROWS]
[--wrap {true,false}] [-v] [--driver-version] [-f FILE] [--change-password] [--log [LOG-FILE]] [--fail-fast | --fail-at-end] [cypher]
A command line shell where you can execute Cypher against an instance of Neo4j. By default the shell is interactive but you can use it for scripting by passing cypher directly on the command line or by piping a file with cypher statements
(requires Powershell on Windows).
example of piping a file:
cat some-cypher.txt | cypher-shell
positional arguments:
cypher an optional string of cypher to execute and then exit
named arguments:
-h, --help show this help message and exit
--fail-fast exit and report failure on first error when reading from file (this is the default behavior)
--fail-at-end exit and report failures at end of input when reading from file
--format {auto,verbose,plain}
desired output format, verbose displays results in tabular format and prints statistics, plain displays data with minimal formatting (default: auto)
-P PARAM, --param PARAM
Add a parameter to this session. Example: `-P "number => 3"` or `-P "country => 'Spain'"`. This argument can be specified multiple times. (default: [])
--non-interactive force non-interactive mode, only useful if auto-detection fails (like on Windows) (default: false)
--sample-rows SAMPLE-ROWS
number of rows sampled to compute table widths (only for format=VERBOSE) (default: 1000)
--wrap {true,false} wrap table column values if column is too narrow (only for format=VERBOSE) (default: true)
-v, --version print version of cypher-shell and exit (default: false)
--driver-version print version of the Neo4j Driver used and exit (default: false)
-f FILE, --file FILE Pass a file with cypher statements to be executed. After the statements have been executed cypher-shell will be shutdown
--change-password change neo4j user password and exit (default: false)
--log [LOG-FILE] enable logging to the specified file, or standard error if the file is omitted
connection arguments:
-a ADDRESS, --address ADDRESS, --uri ADDRESS
address and port to connect to, defaults to neo4j://localhost:7687. Can also be specified using environment variable NEO4J_ADDRESS or NEO4J_URI
-u USERNAME, --username USERNAME
username to connect as. Can also be specified using environment variable NEO4J_USERNAME
--impersonate IMPERSONATE
user to impersonate.
-p PASSWORD, --password PASSWORD
password to connect with. Can also be specified using environment variable NEO4J_PASSWORD
--encryption {true,false,default}
whether the connection to Neo4j should be encrypted. This must be consistent with Neo4j's configuration. If choosing 'default' the encryption setting is deduced from the specified address. For example the
'neo4j+ssc' protocol would use encryption. (default: default)
-d DATABASE, --database DATABASE
database to connect to. Can also be specified using environment variable NEO4J_DATABASE
Cypher-Shell Documentation:
https://neo4j.com/docs/operations-manual/current/tools/cypher-shell/
Other Knowledge Base Articles Utilizing Cypher-Shell:
Comments
0 comments
Please sign in to leave a comment.