cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Graph through terminal

cjsxz
Node Link

A toy example here trying to see if command line access to database graph works:
Opened the neo4j browser for the default database Movie from the neo4j Desktop.

In the Terminal, entered:

from py2neo import Graph
graph = Graph("bolt://localhost:7687")

Error appears:
py2neo.errors.ConnectionUnavailable: Connection has been closed

Any idea why the error?

1 ACCEPTED SOLUTION

cjsxz
Node Link

The bolt connection can be found from the ... - log next to the database name on the neo4j Desktop. It's 0.0.0.0 for the Movie DBMS.

Then the terminal access is ok. Thanks for the above replies.

View solution in original post

4 REPLIES 4

You have to check if the service is indeed running on 7687 of your local machine. If you run multiple instances of Neo4j db in Neo4j browser they are going to listen on different ports. If you run linux, I could also check your firewall settings (ufw).

Here is the message on the neo4j browser directly opened from the desktop. And I'm using a mac os.

You may also have to make a change to the default listen address in the neo4j.conf. Here's the relevant section with the relevant instructions:

# With default configuration Neo4j only accepts local connections.
# To accept non-local connections, uncomment this line:
#dbms.default_listen_address=0.0.0.0

cjsxz
Node Link

The bolt connection can be found from the ... - log next to the database name on the neo4j Desktop. It's 0.0.0.0 for the Movie DBMS.

Then the terminal access is ok. Thanks for the above replies.