latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

Databases
MySQL Databases

Return MySQL databases and users for account

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

Important:

When you disable the MySQL/MariaDB role and remote MySQL is not already configured, the system disables this function.

get/list_mysql_databases_and_users

Query parameters

userstring username required
Example:username

The username for a specified account.

Response

HTTP Request was successful.

Example response

{
  "data": {
    "mysql_config": {
      "mysql-version": "5.5",
      "prefix_length": 8,
      "use_db_prefix": 1
    },
    "mysql_databases": {
      "user1_database1": [
        "user1_user1"
      ],
      "user2_database2": [
        "user2_user2"
      ]
    }
  },
  "metadata": {
    "command": "list_mysql_databases_and_users",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}