'Authentication using Windows cmd and Cypher Shell for Neo4j

When I connect to Cypher Shell using cmd, I type this:

bin\cypher-shell -u neo4j

Immediately after, I'm prompted for a password. I enter the password and connect to Cypher Shell. Yay!

Now, if I try to connect to Cypher Shell using cmd with this command:

bin\cypher-shell -u neo4j - p <password>

I'm given the error:

The client is unauthorized due to authentication failure

Can somebody explain to me why that is?

Thank you



Solution 1:[1]

Use the full connection string for cypher-shell can be in the format:

cypher-shell -a <connection-URI>://<username>:<password>@<host><:port>
or
cypher-shell -a <connection_uri> -u <username> -p <password>

For example:
bin\cypher-shell -a neo4j://neo4juser:[email protected]:7687
or
bin\cypher-shell -a neo4j://127.0.0.1:7687 -u neo4juser -p neo4jpassword

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1