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.

Need to connect to multiple neo4j db using python client

royinblr
Node Link

Is it feasible to connect to multiple neo4j dbs using python client? I am using Neo4j v 4.1.1 Enterprise edition with pip install neo4j ==4.0.2.I have created multiple databases from the browser end http://localhost:7474/browser/.

But whatever python operations (using bolt or using neo4j)I perform,it is working on default neo4j database and not accessing other databases.

I have been using https://pypi.org/project/neo4j/ example codes.

I have checked this post too Cannot create multiple databases through python client(Neo4j 4.0).

Can it be confirmed that it is not possible for python api to connect to multiple neo4j databases running at the same port of the same neo4j enterprise edition instance?

1 ACCEPTED SOLUTION

Thanks for responding @jpek-m.However,one of my colleagues pointed me to the below link yesterday.

And it is working for me . .I have used neo4j protocol,but it may work with bolt as well.

Below is the snippet.

driver = GraphDatabase.driver("bolt://0.0.0.0:7687/", auth=('xx', "xx"), encrypted=False)
session = driver.session(database='Db1')

View solution in original post

3 REPLIES 3

jpek-m
Node Link

Now the manual https://neo4j.com/docs/migration-guide/4.0/upgrade-driver/#upgrade-driver-releases says, that "The Neo4j 4.0 Python and Go drivers are still under construction". We'll wait

Thanks for responding @jpek-m.However,one of my colleagues pointed me to the below link yesterday.

And it is working for me . .I have used neo4j protocol,but it may work with bolt as well.

Below is the snippet.

driver = GraphDatabase.driver("bolt://0.0.0.0:7687/", auth=('xx', "xx"), encrypted=False)
session = driver.session(database='Db1')

Riri2022
Node Link

With this approach, how do you run projections using sessions? session.run('''my query''') worked for some queries but not for projections, so I am wondering how that is done.