How to create database, database username and grant all rights on cPanel server via command line using UAPI

You can create a database, database user, and grant privileges using the cPanel User API (UAPI) command line interface.

Connect to your cPanel account using SSH.

Type the following command to create a new database:

uapi --user='cpanel_username' Mysql create_database name='database_name'

Replace ‘cpanel_username‘ with your cPanel account username and ‘database_name‘ with the name of the database you want to create.… Read the rest