UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/
https://{host}:{port}/execute/
Request
This function sets a MySQL® database user's password.
Important:
When you disable the MySQL role and remote MySQL is not already configured, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Mysql/set_password
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Mysql/set_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/cpanel.openapi/Mysql/set_password?password=12345luggage&user=dbuser'{ "apiversion": 3, "func": "set_password", "module": "Mysql", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function sets a MySQL® database user's privileges.
Important:
When you disable the MySQL/MariaDB role, and remote MySQL is not already configured, the system disables this function.
The database's name.
Important:
If database prefixing is enabled, you must prefix this value with the account prefix and an underscore (_). For example, for the db database on the user cPanel account, pass in a value of user_db.
The database user's name.
Important:
If database prefixing is enabled, you must prefix this value with the account prefix and an underscore (_). For example, for the dbuser user on the user cPanel account, pass in a value of user_dbuser.
ALL PRIVILEGES- A comma-separated list of one or more of the following individual privileges:
ALTERALTER ROUTINECREATECREATE ROUTINECREATE TEMPORARY TABLESCREATE VIEWDELETEDROPEVENTEXECUTEINDEXINSERTLOCK TABLESREFERENCESSELECTSHOW VIEWTRIGGERUPDATE
Note:
- This list replaces, rather than adds to, the existing privilege list.
- In browser-based and command line calls, separate multiple values with
%2Cand replace spaces with%20.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Mysql/set_privileges_on_database
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Mysql/set_privileges_on_database
- 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/cpanel.openapi/Mysql/set_privileges_on_database?database=cpuser_dbname&user=cpuser_dbuser&privileges=DELETE%2CUPDATE%2CCREATE%2CALTER'{ "apiversion": 3, "func": "set_privileges_on_database", "module": "Mysql", "result": { "data": null, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }