Child pages
  • WHM API 1 Functions - installable_mysql_versions
Skip to end of metadata
Go to start of metadata

Description

This function lists all available versions of MySQL® and MariaDB.

Important:

In cPanel & WHM version 76 and later, when you disable the MySQL role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/installable_mysql_versions?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/installable_mysql_versions?api.version=1
 Command Line
whmapi1 installable_mysql_versions


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
  "data": {
    "versions": [
      {
        "version": "5.0",
        "server": "mysql"
      },
      {
        "version": "5.1",
        "server": "mysql"
      },
      {
        "version": "5.5",
        "server": "mysql"
      },
      {
        "version": "5.6",
        "server": "mysql"
      },
      {
        "version": "10.0",
        "server": "mariadb"
      }
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "installable_mysql_versions"
  }
}
 Output (XML)
<result>
    <data>
        <versions>
            <version>5.0</version>
            <server>mysql</server>
        </versions>
        <versions>
            <version>5.1</version>
            <server>mysql</server>
        </versions>
        <versions>
            <version>5.5</version>
            <server>mysql</server>
        </versions>
        <versions>
            <version>5.6</version>
            <server>mysql</server>
        </versions>
        <versions>
            <version>10.0</version>
            <server>mariadb</server>
        </versions>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>installable_mysql_versions</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
versionsarray of hashes

An array of hashes that contain information about the database version information.

This array of hashes includes data from the version and server returns. 

version

string

The version number.

The function returns this value in the versions hash.

A valid string, in major.minor format.10.0

server

string

The server's database engine.

The function returns this value in the versions hash.

  • mysql
  • mariadb
mariadb