In a local Windows desktop, I've loaded the recommendation-embeddings-50.dump
Was very happy when I (eventually) figured you need to :use recommendation-embeddings-50
after loading dump (with backquotes ...)
but now, I can't get the Python driver to connect
auth=("recommendations-embeddings-50", pwd)
(as well as all possible and impossible variants I've tried, including trying to connect to a db alias with no hyphen)
all get a {message: The client is unauthorized due to authentication failure.}
what is the proper syntax to connect to a db that has an hyphen in its name ?
I would happily use a work around by renaming the db, even if I have to reload the dump, but could not find a way to do that either ...
You don't change the auth details if you want to connect to different database. Instead, you'd use the session config database
or the parameter database_
when using driver.execute_query
.
Quick example
URL = "neo4j://localhost:7687" # or wherever the DBMS is hosted
AUTH = ("neo4j", "password") # or whatever username/password for the DBMS (not db)
with neo4j.GraphDatabase.driver(URL, auth=AUTH) as driver:
with driver.session(
database="recommendations-embeddings-50", # or whatever the db hosted on the DBMS is called
) as session:
...
# or with execute_query
driver.execute_query(
...,
database_="recommendations-embeddings-50", # or whatever the db hosted on the DBMS is called
)
thanks a heap @rouven_bauer (so frustrating to be stuck with that kind of stupid thing ... ;-) ...)
can you confirm that there is no way to rename a database ? either when loading a dump or after it's loaded ? (would be nice to be able to get rid of such a cumbersome database name ...)
Not that I'm aware of. Iirc, you can specify a database name when loading a backup. Please take all of this with a grain of salt. I'm mostly working with the drivers so my Cypher and DBA knowledge is rather limited.
1 Like
actually, I'm not through yet because the purpose is to use the driver with the genai package
vectorRetriev = VectorRetriever( driver, index_name="moviePlotsEmbedding", embedder=embedder, return_properties=["title", "plot"], )
is there a way to let it use the proper db ?
Disclaimer: I've never used the genai package. But looking at the API docs it looks like it takes a neo4j_database
config paramter.
1 Like
gosh ! did check the API doc and did not see it ...
#storyOfMyLife
thanks @rouven_bauer
1 Like