Child pages
  • cPanel API 1 Functions - Mysql::adduser

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt

This function creates a MySQL® database user.

Warning
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

  • UAPI (recommended)Mysql::create_user
    Excerpt Include
    UAPI Functions - Mysql::create_user
    UAPI Functions - Mysql::create_user
    nopaneltrue
  • cPanel API 2MysqlFE::createdbuser
    Excerpt Include
    cPanel API 2 Functions - MysqlFE::createdbuser
    cPanel API 2 Functions - MysqlFE::createdbuser
    nopaneltrue
Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleLiveAPI PHP Class
Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$add_mysqluser = $cpanel->api1('Mysql','adduser', array('user','12345luggage') ); // Call the function.

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

 

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

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

Code Block
languagetext
<cpanel Module="Mysql::adduser($FORM('username','password'))">
Expand
titleCommand Line
Code Block
languagebash
cpapi1 --user=username Mysql adduser user 12345luggage

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote

Expand
titleOutput (none)
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.
    Include Page
    LIB:_SDK MySQL Username Limit
    LIB:_SDK MySQL Username Limit

 

user
passwordstring

Required

The MySQL user's password.

A secure password.12345luggage

Returns

This function does not return output.