cPanel API 1 Functions - Mysql::listdbs

Description

This function lists a page's databases.

Warning:

cPanel API 1 is deprecatedDo not use this function. Instead, we strongly recommend that you use the following newer functions:

Examples


 LiveAPI PHP Class

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$list_databases = $cpanel->api1('Mysql','listdbs'); // Call the function.

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $list_databases = $cpliveapi->api1('Mysql','listdbs'); # Call the function.

 cPanel Tag System (deprecated)

Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. This example is present in order to help developers move from the old cPanel tag system to our LiveAPI.

We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

 

<cpanel Module="Mysql::listdbs()">

 Output (HTML)

<b>cpuser_db</b><a
 href="deldb.html?db=cpuser_db"><img 
src="/frontend/x3/images/delete.jpg" border="0" alt="" 
/></a><a href="checkdb.html?db=cpuser_db"><img 
src="/frontend/x3/images/mysqlcheck.gif" border="0" alt="" 
/></a><a href="repairdb.html?db=cpuser_db"><img 
src="/frontend/x3/images/mysqlrepair.gif" border="0" alt="" 
/></a><blockquote><u>Users in db</u><br 
/> 
 cpuser_dbuser
 (Privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, 
INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, CREATE ROUTINE) 
<a 
href="deluserfromdb.html?db=cpuser_db&user=cpuser_dbuser"><img
 src="/frontend/x3/images/delete.jpg" border=0></a> 
 <br /> 
 <blockquote> 
 <table> 
 <tr> 
 <td colspan=2><b>Connection Strings</b></td> 
 </tr> 
 <tr> 
 <td><b>Perl</b></td> 
 <td><i><font
 size=-1>$dbh = 
DBI->connect("DBI:mysql:cpuser_db:localhost",<br 
/>"cpuser_dbuser","&lt;PASSWORD 
HERE&gt;");</i></font></td> 
 </tr> 
 <tr> 
 <td><b>PHP</b></td> 
 <td><i><font
 size=-1>$dbh=mysql_connect ("localhost", "cpuser_dbuser",<br 
/>"&lt;PASSWORD HERE&gt;") or die('Cannot connect to the 
database because: ' . mysql_error());<br />mysql_select_db 
("cpuser_db");</font></i></td> 
 </tr> 
 </table> 
 </blockquote> 
 </blockquote><br
 /><b>cpuser_db2</b><a 
href="deldb.html?db=cpuser_db2"><img 
src="/frontend/x3/images/delete.jpg" border="0" alt="" 
/></a><a href="checkdb.html?db=cpuser_db2"><img 
src="/frontend/x3/images/mysqlcheck.gif" border="0" alt="" 
/></a><a href="repairdb.html?db=cpuser_db2"><img 
src="/frontend/x3/images/mysqlrepair.gif" border="0" alt="" 
/></a></blockquote><br />

Parameters

This function does not accept parameters.

Returns

This function returns HTML with the page's database information.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....