How to Create a MySQL Database Using the cPanel API?

> Please Log in to the server via SSH

> Please run the following command to create the database:

uapi --user=exampl3 Mysql create_database name=db_name

Please NOTE: Please make sure to replace exampl3 with your cPanel username and db_name with the database name,

> Please run the following command to create the database user:

uapi --user=exampl3 Mysql create_user name=db_user password=P@s$w0rd123!

Please NOTE: Please make sure to replace exampl3 with your cPanel username, db_user with the database username and P@s$w0rd123! to the password

> Assign the database user privileges to access the database by running the following command:

uapi --user=exampl3 Mysql set_privileges_on_database user=db_user database=db_name privileges=ALL

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Create a Thumbnail Image Using Thumbnailer in cPanel?

Please note The images that you want to create thumbnails must have uploaded to your cPanel...

How to Suspend or Unsuspend cPanel Accounts?

How to Suspend cPanel Accounts > Please sign in to your WHM account > Please choose...

How to Add Addon Domains in cPanel?

> Please log in to your cPanel account > Please go to Addon Domains under Domains  >...

How to modify an Addon Domain Document Root in cPanel?

> Please click on Addon Domains in cPanel. > Please double-click on the pencil-like icon...

How to remove an Addon Domain?

> Please click on the Addon Domains icon in cPanel > Please scroll down the page and find...

Powered by WHMCompleteSolution