---
title: "Return MySQL databases and users for account"
method: GET
path: "/list_mysql_databases_and_users"
tags: ["Databases", "MySQL Databases"]
---

# Return MySQL databases and users for account

`GET /list_mysql_databases_and_users`

This function retrieves the MySQL® database and user data for the specified account.

**Important:**

When you disable the [MySQL/MariaDB](https://go.cpanel.net/howtouseserverprofiles#roles) role **and** remote MySQL is **not** already configured, the system **disables** this function.

## Query parameters

- `user` string, username, required

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `mysql_config` object — An object that contains the user's MySQL database configuration settings.
      - `mysql-version` string — The MySQL version installed on the server.
      - `prefix_length` 8 | 16 — The maximum number of characters allowed for the prefix on this server.
      - `use_db_prefix` 0 | 1 — Whether database prefixing is enabled on the server. * `1` — Enabled. * `0` — Disabled.
    - `mysql_databases` object — An object that contains database names and users.
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds.
    - `result` 0 | 1 — * `1` — Success. * `0` — Failed. Check the `reason` field for more details.
    - `version` integer — The version of the API function.

---

[API](https://skmtc.net/cpanel/apis/whm-api.md) · [All operations](https://skmtc.net/cpanel/apis/whm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/whm-api/revisions/3da41671c02c/schema)
