Can anyone please help me on how to execute the cypher-shell command by passing username and pwd as environment variables.
I have tried to define these variables in the Environment variables section of Advanced tab in my local desktop. However it is unable to read them and throwing an error as below :
Script is placed in the bin folder of db and executing it from the same location
cypher-shell -d neo4j -f test.cypher
"The client is unauthorized due to authentication failure"
still the same issue here too:
cypher-shell -d neo4j -u $NEO4J_USER_ID -p $NEO4J_PASSWORD -f test.cypher
You first to set both environment variables via EXPORT NEO4J_USERNAME="neo4j" and the same for password
You can also use the
sourcecommand, likesource credentials.envwhen the file contains the credentials, which then will be set as your environment variables.As other posters said you can check the value of your env variables with
echo $NEO4J_USERNAMEor byset | grep NEO4J_