Database users
Database users are managed by Neo4j and need to be updated by you via Cypher from your application or from Neo4j Browser. When using Read-Replicas any change to a database user will automatically propagate to all Replica nodes.
Creating a first user
Upon database creation, Neo4j will create a user with a temporary password. The default user and password are neo4j/neo4j. When you first launch a Neo4j Browser, please enter the neo4j user and temporary neo4j password.
You’ll be prompted to the next window where you’ll need to change the temporary password. When changing the password, please make sure you choose a secure password and store it safely.
If the password can no longer be retrieved or is lost, the authentication can be disabled like this, and then you can change users password, create new user, or whatever you decide is the best course of action.
Managing users
Users can be created and managed using a set of Cypher administration commands that you can easily run from Neo4j Browser or your application. Below you’ll find a set of commands for listing users, creating users, and deleting users, but you can also find a full list of commands in this Neo4j doc.
⚠️ Important
Please ensure you’re using the correct command depending on the Neo4j version of your database.
List Users
cypher
SHOW USERS
Create User
cypher
CREATE USER charlie SET PASSWORD 'password'
Delete User
cypher
DROP USER charlie
Read-only users
We’ve introduced a great new feature called Read-only users, allowing you to reduce the risk of accidental modifications to the database by limiting user access to read-only operations. Additionally, it allows you to minimize the potential impact of user errors or system malfunctions on critical data.
To locate this info, navigate to the Connect tab of your database management view.
If you prepend “RO_” to your username it will automatically have only read privileges. All writes performed by the user will fail automatically. To create a read-only user or to change an existing user you just need to update the username via Cypher from your application or from Neo4j Browser with a RENAME
Cypher request.
RENAME USER neo4j TO RO_neo4j
After this setting is changed, please make sure to login again with RO_xxx user. If the Read-only user tried to write to the database, the error will show, such as the one you can see on the screenshot below.