Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 829885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:57:10+00:00 2026-05-15T03:57:10+00:00

I created new cPanel account, using this account created new database, new database user

  • 0

I created new cPanel account, using this account created new database, new database user and connected user to database, simple stuff. Now, I want this particular user to be able to create new databases, how can I escalate this database user’s permissions to allow creating new databases? I still want these databases to be associated with cPanel account, is adding account name prefix (account_) to database name enough to associate it with that cPanel account?

Edit: Whoops, forgot to mention – database is MySQL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:57:10+00:00Added an answer on May 15, 2026 at 3:57 am

    You sould read the online manual that contains all the proper procedures, but where’s how you can do it:

    <?php
    
    include("xmlapi.php");  
    $db_host = "localhost";  
    $cpuser = "myuser";  
    $databasename = 'mydatabasename';//do not prepend with username
    $databaseuser = 'mydatabaseuser';//api will do that for you
    $databasepass = '123456';
    
    $xmlapi = new xmlapi($db_host);  
    $xmlapi->password_auth("root","root_pass");  
    $xmlapi->set_debug(1);//this setting will put output into the error log in the directory that you are calling script from 
    $xmlapi->set_output('array');//set this for browser output
    
    //create database  
    $createdb = $xmlapi->api1_query($cpuser, "Mysql", "adddb", array($databasename)); 
    foreach($createdb as $v)
    {
        $result = $v['result'];
    }
    if ($result == 1)
    {
        //create user  
        $usr = $xmlapi->api1_query($cpuser, "Mysql", "adduser", array($databaseuser, $databasepass));  
    }
    foreach($usr as $v)
    {
        $result2 = $v['result'];
    }
    if ($result2 == 1)
    {
        //add user to database  
        $addusr = $xmlapi->api1_query($cpuser, "Mysql", "adduserdb", array($databasename, $databaseuser, 'all'));  
    
    }
    print_r($addusr);
    
    
    ?>
    

    This should be adapted to your API, but what it does is allow the DB creation, with a user creation, and finally, associate then!

    Ps: see xmlapi-php-class

    Hope it helps you…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created new PDFs many times using Zend and PHP. But Now I
I have created new configurable products, and attached their simple products with PHP. Now
I have created new room for group chat by using this- XMPPRoomCoreDataStorage *rosterstorage =
i'm using eclipse platform and window builder pro within. I've already created new project
I'm using Kloxo control panel. And if an account is created through kloxo, It
I was wondering whether it is possible to create a new database and user,
I created new bundle (AcmeNotificationBundle) and I want to use it like a service
I have created new authentication method and now need to replace the current home
I just created new columns in my database for my micropost table and these
Every time I create a new forum using the API, the message: Created new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.