9

On Ubuntu 16.04.3 desktop, I've just uninstalled and reinstalled Neo4j. I haven't started it yet. But when I try to set the initial password ...

sudo neo4j-admin set-initial-password 1234

... I get this output:

command failed: initial password was not set because live Neo4j-users were detected.

How can that be? What can I do to set the initial password?

Vishrant
  • 15,456
  • 11
  • 71
  • 120
James Newton
  • 6,623
  • 8
  • 49
  • 113

2 Answers2

19

Delete the data/dbms/auth file if it exists; then restart the db.

In Ubuntu, the dir would be /var/lib/neo4j/data/dbms/

You can also check file locations from here: https://neo4j.com/docs/operations-manual/current/configuration/file-locations/

Hope it helps.

Vishrant
  • 15,456
  • 11
  • 71
  • 120
Lavande
  • 744
  • 8
  • 20
5

I switched from Neo4J version 3.3.2 to 3.2.1 and then executed following command to change my password:

curl -H "Content-Type: application/json" -X POST -d '{"password":"WHATEVER THE PASSWORD IS"}' -u neo4j:neo4j http://localhost:7474/user/neo4j/password

Ref

Vishrant
  • 15,456
  • 11
  • 71
  • 120
  • 3
    For future visitors -- either of the answers here will work but there are different tradeoffs. This answer here that uses the REST API requires that the database be up and running, while the neo4j-admin tool approach can work even if the DB isn't started. – FrobberOfBits Jun 14 '18 at 13:04