1

I'm new here, I hope I will ask my question right:

I work on python with the py2neo package and I'm incapable of connecting to my neo4j Graph database.
It had been working perfectly, but at some point it stopped working (also for scripts that had been working fine before).

The following code where i try to merge a subgraph with the Graph returns an error message:

from py2neo import Graph graph = Graph(password="passwordforgraph") graph.merge(subgraph)

This is the error message: ServiceUnavailable: Failed to establish connection to ('127.0.0.1', 7687) (reason [WinError 10061] Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd)

When checking the details of my graph in my neo4j browser i found out my Bolt port is 11004 and not 7687 (which is the default and which, judging from the error message, is the port my python tried to connect to).

My questions are the following: How can I change the Bolt port in my graph object in python from 7687 to 11004. And (if possible) how can i change the integer of the Bolt port of the Graph-datagase itself, and put it back to it's default value. And finally which of the two solutions would be wiser in my case.

Marciemarc
  • 11
  • 2
  • The Graph class has a bolt_port member in version 3 that could be the port you need to initialize to match your Bolt client connection. So all you would need to do is `graph = Graph(password="passwordforgraph", bolt_port=11004)`. Alternatively, you could use the entire address in the bolt object init: `graph = Graph("bolt://localhost:11004", password="passwordforgraph")` – BoboDarph Feb 11 '19 at 15:27
  • Be advised that the connection could fail if using the second solution if localhost is not mapped to a local address, so you could use your loopback interface ip instead of hostname (127.0.0.1) – BoboDarph Feb 11 '19 at 15:33

0 Answers0