---
title: "Database users"
url: https://docs.corefinity.com/guides/sites/database/database-users
type: guide
last_updated: 2026-11-13
feature: database
related:
  - https://docs.corefinity.com/api/reference/database/reveal-site-database-login.md
  - https://docs.corefinity.com/api/reference/database/get-site-database.md
  - https://docs.corefinity.com/api/reference/database/get-site-database-operation.md
  - https://docs.corefinity.com/api/reference/database/create-site-database-user.md
  - https://docs.corefinity.com/api/reference/database/update-site-database-user.md
  - https://docs.corefinity.com/api/reference/database/delete-site-database-user.md
  - https://docs.corefinity.com/mcp/tools/corestack_db_credentials_get.md
  - https://docs.corefinity.com/mcp/tools/corestack_db_export.md
  - https://docs.corefinity.com/mcp/tools/corestack_db_import.md
  - https://docs.corefinity.com/mcp/tools/corestack_external_db_get.md
  - https://docs.corefinity.com/mcp/tools/corestack_external_db_user_add.md
  - https://docs.corefinity.com/mcp/tools/corestack_external_db_user_update.md
---
# Database users

Add a database login for a reporting or agency tool, rotate its password, and remove it when it is no longer needed.

## Before you start

- You can open the site in **Managed Websites**. Anyone who can open a site can add, change and delete its database users.
- Each environment has its own database users, up to 10: choose **Production** or **Staging** in the site header first.
- An **Internal** user connects from inside the site only: scheduled tasks, the terminal and the SSH tunnel. An **External** user needs [external access](/guides/sites/database/external-access).

## Add a database user

1. **Open Database**

   Go to **Managed Websites**, choose the site, then **Database** under **Site settings**. On the **Database users** card, choose **Add user**.

   _Screenshot: A site page with Database ringed in the menu. The Connection details card shows the host, port and database name; the Database users card lists application, reporting and agency_tools._

2. **Name the user and choose its access**

   Enter a **Username** of 3 to 32 lower-case letters, digits and underscores, starting with a letter. Under **Access**, choose what the user may do.

   | Access         | The user can                                                                                                              |
   | -------------- | ------------------------------------------------------------------------------------------------------------------------- |
   | **Read-only**  | Read the environment's database.                                                                                          |
   | **Read-write** | Also add, change and delete data. It cannot create or drop tables, create users, change grants or reach another database. |

   _Screenshot: The Add a database user dialog with the username metabase, the Access choices Read-only and Read-write, and the Password choices Generate one for me and Set my own._

3. **Choose the password**

   Leave **Password** on **Generate one for me**, or choose **Set my own** and enter 12 to 64 characters.

4. **Add the user and copy the password**

   Choose **Add user**; for **Read-write**, type `read-write` to confirm first. The password is shown once: copy it, then choose **I've copied it**.

The user joins the list. To connect from your computer, open the tunnel on [Connection details](/guides/sites/access-and-security/connection-details).

## Change, rotate or delete a user

1. **Use the buttons on the user's row**

   | Button              | What it does                                                                                                        |
   | ------------------- | ------------------------------------------------------------------------------------------------------------------- |
   | **Edit**            | Changes the access. The name and kind cannot change: delete the user and add a new one.                             |
   | **Rotate password** | Sets a new password, shown once. The old one stops working at once, so update the tool that uses it straight after. |
   | The bin             | Deletes the user. The tool using it can no longer sign in, and this cannot be undone.                               |

   _Screenshot: The Database users card, 2 of 10: the protected application login with Reveal, then reporting, read-only, and agency_tools, read-write, both internal, each with Edit, Rotate password and a bin._

The site's own login, `application`, is always on the list and cannot be changed. **Reveal** on its row shows its username and password, and every reveal is logged.

## Automate this

**API:** [Create a database user](https://docs.corefinity.com/api/reference/database/create-site-database-user.md), scope `write`

```bash
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/database/users \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "confirm_read_write": "read-write",
    "kind": "external",
    "max_statement_time": 30,
    "max_user_connections": 5,
    "password": {
      "mode": "set",
      "value": "example-password-not-a-secret"
    },
    "require_tls": true,
    "scope": "read_write",
    "username": "erp_sync"
  }'
```

**MCP:** [`corestack_external_db_user_add`](https://docs.corefinity.com/mcp/tools/corestack_external_db_user_add.md), scope `write`

```json
{
  "name": "corestack_external_db_user_add",
  "arguments": {
    "site_id": 4211,
    "kind": "internal",
    "username": "reporting_ro",
    "scope": "read_only",
    "password": {
      "mode": "generate"
    }
  }
}
```

**Control Panel:** Managed Websites › your site › Site settings › Database ([https://manage.corefinity.com/go/database](https://manage.corefinity.com/go/database))

## Related

- [External access](/guides/sites/database/external-access): Let an outside system reach the database.
- [Connection details](/guides/sites/access-and-security/connection-details): Find the host, port and commands.
- [Import and export](/guides/sites/database/import-and-export): Export a database or import a file.
