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.

Cannot alias database connection string in conf/neo4j.conf when using apoc.load.jdbc()

I have neo4j installed using docker-compose and successfully enabled apoc plug-in.

I'm able to use call apoc.load.jdbc("hard-coded-db-connection-string", "my-table") to retrieve data from my database which is good.
Of course, this is not convenient, so I tried to alias the connection string by adding below to the conf/neo4j.conf.
apoc.jdbc.mydb.url=jdbc:postgresql://"hard-coded-db-connection-string
and then restarted the container. However i can't call the apoc using the alias and I see a message in the log:
Unrecognized setting. No declared setting with name: apoc.jdbc.mydb.url

I also tried to run below to check the settings in the conf/neo4j.conf file, but the results don't show the alias line i just added.

CALL dbms.listConfig()
YIELD name, value
WHERE name STARTS WITH 'apoc.'
RETURN name, value
ORDER BY name
;

Wondering can someone help me troubleshooting this? Is this because I was working on the wrong conf file? Thx!

1 REPLY 1

APOC >= 4.0 expects configuration in either conf/apoc.conf, env variables or system properties. See https://neo4j.com/labs/apoc/4.1/config/ for details.

Reason: Neo4j 4.0 does no longer accept dynamic (aka not decleared at compile) settings for neo4j.conf - so we needed to go a different route.

That said you could also use java.jvm.additional settings to declare system properties using -D<key>=<value>.