Neo4j create new user

To create a new user in Neo4j, you can use the following methods:

Method 1: Using the Neo4j Browser

  1. Open the Neo4j Browser by navigating to http://localhost:7474 (or the URL of your Neo4j instance).
  2. Log in with your existing credentials.
  3. Click on the "Users" tab in the top navigation bar.
  4. Click on the "Create User" button.
  5. Fill in the required information, such as username, password, and email address.
  6. Click "Create" to create the new user.

Method 2: Using the Neo4j CLI

  1. Open a terminal or command prompt.
  2. Run the following command to create a new user:
    neo4j-shell -username <existing_username> -password <existing_password> -c "CREATE USER <new_username> WITH PASSWORD '<new_password>'"

    Replace <existing_username> and <existing_password> with your existing Neo4j credentials, and <new_username> and <new_password> with the desired credentials for the new user.

Method 3: Using the Neo4j REST API

  1. Send a POST request to the Neo4j REST API endpoint /db/data/user with the following JSON payload:
    {
    "username": "<new_username>",
    "password": "<new_password>",
    "email": "<new_email>"
    }

    Replace <new_username>, <new_password>, and <new_email> with the desired credentials for the new user.

For example, using curl:

curl -X POST \
  http://localhost:7474/db/data/user \
  -H 'Content-Type: application/json' \
  -d '{"username": "newuser", "password": "newpassword", "email": "[email protected]"}'

Note: Make sure to replace localhost:7474 with the URL of your Neo4j instance.

After creating the new user, you can log in with the new credentials to access the Neo4j Browser or use the new credentials to connect to the Neo4j instance using the Neo4j CLI or other tools.