How to Create a MySQL Database Using the cPanel API Updated on August 16, 2021 by InMotion Hosting Contributor 1 Minutes, 48 Seconds to Read If you are running cPanel on your server, then you should use the cPanel API to create the database from the command line. Creating the database this way, allows for cPanel to integrate the necessary permissions for each cPanel user to access the databases they are granted access to. For instance, if you create a database from the command line using MySQL, the database will not appear in the cPanel interface or phpMyAdmin. In this guide, you can learn the commands to create a MySQL database, database user and password, as well as, assign all privileges to the user for the database. Create a Database Using cPanel APIcPanel MySQL® Database Wizard Don’t have time to read the article? Watch our walk-through video. Create a Database Using cPanel API Log into your server via SSH. Run the following command to create the database:uapi --user=exampl3 Mysql create_database name=db_name NOTE: Be sure to replace exampl3 with your actual cPanel username and db_name with the actual name you would like to give to the database. Run the following command to create the database user:uapi --user=exampl3 Mysql create_user name=db_user password=P@s$w0rd123! NOTE: Be sure to replace exampl3 with your actual cPanel username, db_user with the actual name you would like to give to the database user, and P@s$w0rd123! to the actual password you would like to assign to this user. 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 NOTE: Be sure to replace exampl3 with your actual cPanel username, db_user with your actual database user, and db_name with the actual name of the database. cPanel MySQL® Database Wizard The cPanel MySQL® Database Wizard creates a database, as well as a database user and password. The Wizard also completes the process of assigning privileges to the database user (to use the database as needed). For step-by-step instructions you can refer to our guide: How to Create a MySQL Database in cPanel.Share this Article IC InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles How to Configure cPanel in WHM Resetting the cPanel Password in WHM How to Import Email Accounts and Forwarders into cPanel How to Install WHMCS With Softaculous What is your default PHP.ini file? How to Create / Delete an FTP Account in cPanel How to Park a Domain in cPanel How to Permanently Delete Trash in File Manager The Complete Guide to cPanel Backups How to Delete a cPanel in WHM