Description

This function grants permissions to a MySQL® database user.



Examples




$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$add_perms = $cpanel->api1('Mysql','adduserdb', array('database','username','alter lock create') ); // Call the function.



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $add_perms = $cpliveapi->api1('Mysql','adduserdb', ['database','username','alter lock create'] ); # Call the function.


<cpanel Module="Mysql::adduserdb( $FORM('dbname','user','perms_list'))">




cpapi1 --user=username Mysql adduserdb database user "alter lock create"


This function does not return output.



Parameters

ParameterTypeDescriptionPossible valuesExample
dbnamestring

Required

The MySQL database name.

A valid MySQL database.

database
usernamestring

Required

The MySQL user's name.

A valid MySQL user.user
perms_liststring

Required

The permissions to grant to the MySQL user.

Use any of the following values in a space-delimited list:
  • alter — ALTER
  • temporary CREATE TEMPORARY TABLES
  • routine CREATE ROUTINE
  • create CREATE
  • delete DELETE
  • drop DROP
  • select SELECT
  • insert INSERT
  • update UPDATE
  • references REFERENCES
  • index INDEX
  • lock LOCK TABLES
  • all ALL
alter lock create

Returns

This function does not return output.