---
title: Managing the default user's username and password
description: Learn to manage Redis™ usernames and passwords using API/CLI.
tags: databases user redis username password
dates:
  validation: 2025-10-29
---
import Requirements from '@macros/iam/requirements.mdx'


When you create a Redis™<sup>*</sup> Database Instance, you have to specify a user. It will be created with [set permissions](/managed-databases-for-redis/reference-content/default-user-permissions/).

You can specify a name for this user when you create a Database Instance. This allows you to ensure the username is compatible with different software integrations where specific usernames are not supported.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- A valid [API key](/iam/how-to/create-api-keys/)
- Downloaded and installed the [Scaleway CLI](https://github.com/scaleway/scaleway-cli#scaleway-cli-v2)
- [Configured your environment variables](https://github.com/scaleway/scaleway-cli/blob/master/docs/commands/config.md) (optional)

## Specifying a name for a user

Follow the [create a Database Instance](https://www.scaleway.com/en/developers/api/managed-databases-for-redis/#quickstart) procedure.

<Message type="tip">
You can also define a username when you [create a Redis™ Database Instance](/managed-databases-for-redis/how-to/create-a-database-for-redis/) via the Scaleway console.
</Message>

You are required to specify a username and password for the default user in your POST request payload.

<Message type="important">
<br />
For a username to be valid, it must:
  - contain only letters, numbers, hyphens, dollars, and underscores
  - be between 1 and 63 characters long
  - not start with `_rkv`
  - start with a letter
  - not be `scalewayadmin` or `metrics`
</Message>

## Retrieving the default username

You can retrieve the default username via the API and the CLI.

<Tabs>
  <TabsTab label="API">
    Run the following curl command in a terminal to `GET` information about your Redis™ Database Instance of choice and retrieve the default username. Replace `zone` and `cluster_id` in the path with the zone and cluster ID of your Database Instance of choice.

    ```bash
    curl -X GET \
    -H "X-Auth-Token: $SCW_SECRET_KEY" \
    'https://api.scaleway.com/redis/v1/zones/{zone}/clusters/{cluster_id}'
    ```
  </TabsTab>

  <TabsTab label="CLI">

    Run the following command in a terminal to `GET` information about your Redis™ Database Instance. Replace `<cluster_id>` with the ID of your Database Instance of choice.

    ```bash
    scw redis cluster get <cluster-id>
    ```

  </TabsTab>
</Tabs>

A response like the following is returned:

```json
{
"id": "string",
"name": "string",
"project_id": "string",
"status": "string",
"version": "string",
"endpoints": [],
"tags": [],
"node_type": "string",
"created_at": "string",
"updated_at": "string",
"tls_enabled": "boolean",
"cluster_settings": [],
"acl_rules": [],
"cluster_size": "integer",
"zone": "string",
"user_name": "redis-admin",
"upgradable_versions": []
}
```

<Message type="important">
  The example above is a simplified version of the response. `strings` and `boolean` are replaced with actual values in a real response.
</Message>

You can find the default username under `"user_name":`. In this example, the default username is `redis-admin`.

## Changing the default username

You can change the username and password of the default user anytime via the API and the CLI.

<Tabs>
  <TabsTab label="API">
    Run the following curl command in a terminal to update your Redis™ Database Instance. Replace `zone` and `cluster_id` in the path with the zone and cluster ID of your Database Instance of choice. In the body of the request, replace `<your-new-username>` and `<your-new-password>` with your username and password of choice.

    ```bash
    curl -X PATCH \
    -H "X-Auth-Token: $SCW_SECRET_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "user_name":"<your-new-username>",
      "password":"<your-new-password>"
      }' \
    "https://api.scaleway.com/redis/v1/zones/{zone}/clusters/{cluster_id}"
    ```

    A response including the information of your Database Instance appears to indicate the update was successful.
  </TabsTab>

  <TabsTab label="CLI">

    Run the following command in a terminal to `GET` information about your Redis™ Database Instance. Replace `<cluster_id>` with the ID of your Database Instance of choice. Replace `<cluster-id>` with your Database Instance ID, and  `<your-new-username>` and `<your-new-password>` with your username and password of choice.

    ```bash
    scw redis cluster update <cluster-id> user-name="<your-new-username>" password="<your-new-password>"
    ```

  </TabsTab>
</Tabs>

<br/>
<sup>*</sup> <small>Redis is a trademark of Redis Labs Ltd. Any rights therein are reserved to Redis Labs Ltd. Any use by Scaleway is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and Scaleway. </small>