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.

SecurityBasicAuth
Request
query Parameters
user
required
string <username>

The username for a specified account.

Example: user=username
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/list_mysql_databases_and_users
Request samples
whmapi1 --output=jsonpretty \
  list_mysql_databases_and_users \
  user='username'
Response samples
application/json
{
  • "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
    }
}