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.

How to specify to connect to a particular database name in enterprise version when using BOLT

I was trying to give the Fine-grained permissions in enterprise version .So I have different databases for different purposes .How do I specify the bolt config to point to a different database instead of neo4j?

[yz@hostname ~]$ env | grep NEO

NEO4J_DB_HOST=*******

NEO4J_DB_PORT=7687

NEO4J_DB_USERNAME=cs_ratesearch

NEO4J_DB_PASSWORD=****

bolt://{NEO4J_DB_HOST}:{NEO4J_DB_PORT}

This will connect directly to “neo4j” default database which is not a surprise .But how will I specify in bolt to connect to a different database ?

bolt://{NEO4J_DB_HOST}:{NEO4J_DB_PORT}/NEO4J_DB_NAME -- tried this didn't work

Any help will be appreciated

Thanks
Sojan

6 REPLIES 6

Which driver/tool are you using to connect? You have to pass the database name to that tool, it doesn't go in the connection string..

jggomez
Graph Voyager

If you are using neo4j 3.5, it is impossible. If you are using neoj 4.0, it has support for multi-database and will be selectable per session but the python driver is in beta.

You could change the database you want to use in the conf neo4j file on your server.

(Almost a year later...). I looked for the selection of the database by name in the neo4j driver documentation, but I couldn't find one....

I tried the py2neo driver, but I couldn't quite get it to work:

from py2neo import Graph
g = Graph("bolt://localhost:7687", auth=("neo4j", "PASSWORD"), name="movies")
g.run("MATCH (a:Person) RETURN a.name, a.born LIMIT 4").data()

and got back an empty list.

If I use a bogus name for the DB instead of "movies", I get an expected error when matching:

ClientError: [Database.DatabaseNotFound] Database does not exist. Database name: 'xxxx'.

So, I believe that somehow the driver has found the 'movie' DB, but I don't know what went wrong.

okaytouch
Node Clone

Hello, how to acheive this with Javascript Driver?
Thanks

From the documentation, it looks like it can be specified during session creation. See section '3. Session configuration' in following:

Looks like you pass a map with your configuration parameters. The following is an example from the documentation:

okaytouch
Node Clone

Hello, I find the answer in driver configuration