Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Proper way to create database via ssh?

Discussion in 'cPanel Developers' started by Ishware, Apr 7, 2016.

  1. Ishware

    Ishware Well-Known Member

    Joined:
    Nov 7, 2003
    Messages:
    193
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    Panama City, FL
    cPanel Access Level:
    Root Administrator
    I've figured out how to create a new account using whmapi1, so I was trying to further work towards scripting my common cPanel needs - creating a database, then a user, then granting privs.

    I found this: cPanel API 2 Functions - MysqlFE::createdb - Software Development Kit - cPanel Documentation

    It points me to this: https://documentation.cpanel.net/display/SDK/UAPI+Functions+-+Mysql%3A%3Acreate_database

    Now, I also got pointed to this: Guide to UAPI - Software Development Kit - cPanel Documentation

    That says that for command-line, I should use "uapi". But I don't appear to have that command available when I ssh in as root to my server. How do I get it?

    Or, more importantly: How can I properly create a database, then a user, then assign that user with full privs — all via ssh?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    cPanel & WHM introduced the command line feature for UAPI in version 56. It's currently only available on the "Edge" build tier, but it's tentatively expected in the "Current" build tier next week. The release tiers are explained at:

    cPanel & WHM Product Versions and the Release Process - cPanel Knowledge Base - cPanel Documentation

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Ishware

    Ishware Well-Known Member

    Joined:
    Nov 7, 2003
    Messages:
    193
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    Panama City, FL
    cPanel Access Level:
    Root Administrator
    Ah, so my timing isn't perfect, only ALMOST perfect. Thanks! :)
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice