Description
This function lists a user's privileges on a MySQL® database.
Warning:
- This function is currently deprecated and does not function. We strongly recommend that you use the
MysqlFE::getdbuserprivileges
function. - We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
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 |
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
Note:
This function's Boolean values only return if the database user has privileges for that database. If the value is 0
, the function will not return that value.
Return
|
Type
|
Description
|
Possible values
|
Example
|
---|---|---|---|---|
ALL PRIVILEGES |
Boolean | Whether the user has all privileges on the database. |
|
1 |
ALTER |
Boolean | Whether the user has this privilege on the database. |
|
1 |
|
Boolean | Whether the user has this privilege on the database. |
|
1 |
CREATE |
Boolean | Whether the user has this privilege on the database. |
|
1 |
|
Boolean | Whether the user has this privilege on the database. |
|
1 |
CREATE TEMPORARY TABLES |
Boolean | Whether the user has this privilege on the database. |
|
1 |
CREATE VIEW |
Boolean | Whether the user has this privilege on the database. |
|
1 |
DELETE |
Boolean | Whether the user has this privilege on the database. |
|
1 |
DROP |
Boolean | Whether the user has this privilege on the database. |
|
1 |
EVENT |
Boolean | Whether the user has this privilege on the database. |
|
1 |
EXECUTE |
Boolean | Whether the user has this privilege on the database. |
|
1 |
INDEX |
Boolean | Whether the user has this privilege on the database. |
|
1 |
INSERT |
Boolean | Whether the user has this privilege on the database. |
|
1 |
LOCK TABLES |
Boolean | Whether the user has this privilege on the database. |
|
1 |
REFERENCES |
Boolean | Whether the user has this privilege on the database. |
|
1 |
SELECT |
Boolean | Whether the user has this privilege on the database. |
|
1 |
|
Boolean | Whether the user has this privilege on the database. |
|
1 |
TRIGGER |
Boolean | Whether the user has this privilege on the database. |
|
1 |
UPDATE |
Boolean | Whether the user has this privilege on the database. |
|
1 |
reason |
string |
A reason for failure. Note: This function only returns a |
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |