Description
This function grants privileges to a user on a database.
Warning:
We strongly recommend that you use the following UAPI function instead of this function:
-
Mysql::set_privileges_on_database
— This function sets a MySQL® database user's privileges.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
privileges |
string |
Required The privileges to grant to the database user. Important: This list replaces, rather than adds to, the existing privilege list. |
Note: In browser-based calls, separate multiple values with %2C and replace spaces in privilege names with %20. |
"UPDATE,ALTER" |
db |
string |
Required The database name. |
A valid database name. |
example_db1 |
dbuser |
string |
Required The database username. |
A valid database username. |
example_user1 |
Returns
Return |
Type |
Description |
Possible values |
Example |
reason |
string |
A reason for failure. Note: This function only returns a reasonvalue if it failed. |
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |