Proper way to create database via ssh?

Ishware

Well-Known Member
Nov 7, 2003
211
6
168
Williamsburg, VA
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
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?
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.