Description

This function creates a MySQL® database user.

Examples


$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$add_mysqluser = $cpanel->api1('Mysql','adduser', array('user','12345luggage') ); // Call the function.

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $add_mysqluser = $cpliveapi->api1('Mysql','adduser', ['user','12345luggage'] ); # Call the function.

<cpanel Module="Mysql::adduser($FORM('username','password'))">
cpapi1 --user=username Mysql adduser user 12345luggage

This function does not return output.

Parameters

ParameterTypeDescriptionPossible valuesExample
usernamestring

Required

The MySQL user's name.

  • If database prefixing is enabled, this will be the cPanel account name, an underscore, and the username
  • If database prefixing is disabled, this will be only the username.

 

user
passwordstring

Required

The MySQL user's password.

A secure password.12345luggage

Returns

This function does not return output.