Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-02-2020 10:12 AM
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
06-05-2020 07:02 AM
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..
06-05-2020 11:24 AM
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.
05-14-2021 12:52 PM
(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.
02-17-2022 07:49 PM
Hello, how to acheive this with Javascript Driver?
Thanks
02-17-2022 09:00 PM
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:
02-20-2022 06:24 PM
Hello, I find the answer in driver configuration
All the sessions of the conference are now available online