The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    168
    Likes Received:
    0
    Trophy Points:
    16
    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::create_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:
    30,745
    Likes Received:
    662
    Trophy Points:
    113
    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.
     
  3. Ishware

    Ishware Well-Known Member

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

Share This Page