Set an initial password

Use the set-initial-password command of neo4j-admin to define the password for the native user neo4j. This must be performed before starting up the database for the first time.

If the password is not set explicitly using this method, it will be set to the default password neo4j. In that case, you will be prompted to change the default password at first login.

The default minimum password length is 8 characters.

Use the dbms.security.auth_minimum_password_length configuration setting to change the default minimum value.

Syntax:

neo4j-admin dbms set-initial-password <password> [--require-password-change]

Example 1. Use the set-initial-password command of neo4j-admin

Set the password for the native neo4j user to 'h6u4%krd' before starting the database for the first time.

bin/neo4j-admin dbms set-initial-password h6u4%krd
Example 2. Use the set-initial-password command of neo4j-admin with the optional --require-password-change flag

Set the password for the native neo4j user to 'secretpassword' before starting the database for the first time. You will be prompted to change this password to one of your own choice at first login.

bin/neo4j-admin dbms set-initial-password secretpassword --require-password-change