- Created by Documentation, last modified on Oct 05, 2018
disable_authentication_provider
disable_failing_authentication_providers
enable_authentication_provider
get_available_authentication_providers
get_provider_client_configurations
get_provider_configuration_fields
get_provider_display_configurations
get_users_authn_linked_accounts
set_provider_client_configurations
set_provider_display_configurations
twofactorauth_generate_tfa_config
twofactorauth_get_user_configs
cpgreylist_is_server_netblock_trusted
cpgreylist_list_entries_for_common_mail_provider
cpgreylist_load_common_mail_providers_config
cpgreylist_save_common_mail_providers_config
cpgreylist_trust_entries_for_common_mail_provider
cpgreylist_untrust_entries_for_common_mail_provider
create_cpgreylist_trusted_host
delete_cpgreylist_trusted_host
Description
This function resets the root
user's password on the local MySQL® server.
Important:
MySQL
role, the system disables this function. For more information, read our How to Use Server Profiles documentation.Examples
https://hostname.example.com:2087/cpsess##########/json-api/set_local_mysql_root_password?api.version=1&password=12345luggage
https://hostname.example.com:2087/cpsess##########/xml-api/set_local_mysql_root_password?api.version=1&password=12345luggage
whmapi1 set_local_mysql_root_password password=12345luggage
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
{ "data": { "password_reset": 1 }, "metadata": { "version": 1, "reason": "OK", "result": 1, "command": "set_local_mysql_root_password" } }
<result> <data> <password_reset>1</password_reset> </data> <metadata> <version>1</version> <reason>OK</reason> <result>1</result> <command>set_local_mysql_root_password</command> </metadata> </result>
Note:
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
password | string | Required The new MySQL | A valid string. | 12345luggage |
update_config | Boolean | Whether to update the configuration files. Warning: This parameter updates the
|
| 1 |
Returns
Return | Type | Description | Possible values | Example |
---|---|---|---|---|
password_reset | Boolean | Whether the system reset the password. |
| 1 |
configs_updated | Boolean | Whether the system updated the configuration settings. Note: This return only appears when the function includes the |
| 1 |
profile_updated | Boolean | Whether the system updated the profile. Note: This return only appears when the localhost MySQL profile is active. |
| 1 |
Function information
API Version:
Available in:
WHM 11.52+
Methods:
GET, POST
Required Parameters:
password
Return Formats:
About WHM API 1
WHM API 1 performs functions and accesses data in WHM.
Notes:
- Some functions and parameters may require that you authenticate as the
root
user. - You must use the appropriate WHM ports (
2086
or2087
) to call WHM API functions.
Find a function
Related functions
-
Page:WHM API 1 Sections - Databases — Database functions allow you to manage your MySQL® and PostgreSQL® database settings.
-
Page:WHM API 1 Functions - background_mysql_upgrade_status — This function retrieves the status of a background MySQL® or MariaDB® upgrade.
-
Page:WHM API 1 Functions - current_mysql_version — This function retrieves the server's version of MySQL® or MariaDB®.
-
Page:WHM API 1 Functions - installable_mysql_versions — This function lists all available versions of MySQL® and MariaDB.
-
Page:WHM API 1 Functions - latest_available_mysql_version — This function retrieves the latest available version of MySQL® or MariaDB®.