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

Description

This function retrieves the server's version of MySQL® or MariaDB®.

Important:

In cPanel & WHM version 76, the MySQL role affects this function.

Examples 


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


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/api/whmapi1

 Output (JSON)
{
  "data": {
    "version": "10.0",
    "server": "mariadb"
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "current_mysql_version"
  }
}
 Output (XML)
<result>
    <data>
        <version>10.0</version>
        <server>mariadb</server>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>current_mysql_version</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

version

string

The version number.

A valid string, in major.minor format.10.0

server

string

The server's database engine.

  • mysql
  • mariadb
mariadb