0

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
Charchit Kapoor
  • 8,934
  • 2
  • 8
  • 24
Chaitan
  • 21
  • 1

1 Answers1

0

You first to set both environment variables via EXPORT NEO4J_USERNAME="neo4j" and the same for password

You can also use the source command, like source credentials.env when 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_USERNAME or by set | grep NEO4J_

Michael Hunger
  • 41,339
  • 3
  • 57
  • 80