Description
This function deletes a MySQL® database.
Examples
cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Mysql/delete_database?name=example
LiveAPI PHP Class
$cpanel
=
new
CPANEL();
$delete_db
=
$cpanel
->uapi(
'Mysql'
,
'delete_database'
,
array
(
'name'
=>
'example'
,
)
);
LiveAPI Perl Module
my
$cpliveapi
= Cpanel::LiveAPI->new();
my
$delete_db
=
$cpliveapi
->uapi(
'Mysql'
,
'delete_database'
,
{
'name'
=>
'example'
,
}
);
cPanel Template Toolkit
[% execute('Mysql', 'delete_database', { name => 'example' } ) %]
Command Line
uapi --user=username Mysql delete_database name=example
|
Output (JSON)
{
"messages": null,
"errors": null,
"status": 1,
"metadata": {
},
"data": null
}
Parameters
Parameter
|
Type
|
Description
|
Possible values
|
Example
|
name
|
string
|
Required
The database's name.
|
A MySQL database on the cPanel account.
|
example
|
Returns
This function only returns metadata.