Description

This function deletes a MySQL® user.

Examples 


https://hostname.example.com:2083/cpsess##########/execute/Mysql/delete_user?name=example

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Delete the example MySQL user.
$delete_user = $cpanel->uapi(
    'Mysql', 'delete_user',
    array(
        'name'       => 'example',
    )
);

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Delete the example MySQL user.
my $delete_user = $cpliveapi->uapi(
    'Mysql', 'delete_user',
    {
        'name'       => 'example',
    }
);

<!-- Delete the example MySQL user. -->
[% execute('Mysql', 'delete_user', { name => 'example' } ) %]

uapi --user=username Mysql delete_user name=example

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
     
  },
  "data": null
}

Parameters

ParameterTypeDescriptionPossible valuesExample
namestring

Required

The MySQL user's name.

A MySQL user on the cPanel account.

example

Returns

This function only returns metadata.