Description

This function updates a database user's privileges.



Examples




$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$update_privs = $cpanel->api1('Mysql','updateprivs', array('example_user1','example_database') ); // Call the function.



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $update_privs = $cpliveapi->api1('Mysql','updateprivs', ['example_user1','example_database'] ); # Call the function.


<cpanel Module="Mysql::updateprivs($FORM('dbuser','db')">




cpapi1 --user=username Mysql updateprivs dbuser=example_user1 db=example_database



{
   "func" : "updateprivs",
   "event" : {
      "result" : 1
   },
   "data" : {
      "result" : ""
   },
   "module" : "Mysql",
   "type" : "event",
   "apiversion" : "1",
   "source" : "module"
}




Parameters

ParameterTypeDescriptionPossible valuesExample
dbuserstring

Required

The database user's name.

A valid username.
example_user1
dbstring

Required

The database's name.

A valid database name.example_database

Returns

This function returns a list of updated user privileges on the database.