WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function retrieves the latest available version of MySQL® or MariaDB®.
Important:
When you disable the MySQL/MariaDB role and remote MySQL is not already configured, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/latest_available_mysql_version
- A server running WHM.
https://whm-server.tld:2087/json-api/latest_available_mysql_version
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/latest_available_mysql_version{ "data": { "server": "mariadb", "version": "10.0" }, "metadata": { "command": "latest_available_mysql_version", "reason": "OK", "result": 1, "version": 1 } }
Request
This function resets the root user's password on the local MySQL® server.
Important:
When you disable the MySQL/MariaDB role and remote MySQL is not already configured, the system disables this function.
Whether to update the configuration files.
1— Update.0— Do not update.
Note:
This value is always enabled when localhost is the active profile, and must be specified explicitly when a remote profile is active.
Warning:
This parameter updates the /root/.my.cnf file with the new password, which could cause problems with the MySQL configuration on the server. If you are unsure, do not specify this parameter.
- If you set this parameter to
0when localhost is the active profile, it will stop communication with the remote MySQL server until you update the profile's password. - If you set this parameter to
1when a remote host is the active profile, it will stop communication with the remote MySQL server until you update the profile's password.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/set_local_mysql_root_password
- A server running WHM.
https://whm-server.tld:2087/json-api/set_local_mysql_root_password
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/set_local_mysql_root_password?password=12345luggage&update_config=1'{ "data": { "configs_updated": 1, "password_reset": 1, "profile_updated": 1 }, "metadata": { "command": "set_local_mysql_root_password", "reason": "OK", "result": 1, "version": 1 } }
Request
This function upgrades MySQL® or MariaDB® in the background. This will reinstall MySQL® or MariaDB® if the version given is the installed version.
Important:
When you disable the MySQL/MariaDB server role and remote MySQL® is not already configured, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/start_background_mysql_upgrade
- A server running WHM.
https://whm-server.tld:2087/json-api/start_background_mysql_upgrade
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/start_background_mysql_upgrade?version=5.7'{ "data": { "upgrade_id": "mysql_upgrade.20200202-172923" }, "metadata": { "command": "start_background_mysql_upgrade", "reason": "OK", "result": 1, "version": 1 } }