Fast, secure hosting for websites that mean business.

How to Create a MySQL Database in cPanel

Create a database and database user for a website application through cPanel.

Many dynamic websites require a MySQL or MariaDB database to store application data.

Open cPanel and use the database-management tools available for your hosting account. Create a new database and then create a database user with a strong, unique password.

After creating both, assign the user to the database and grant only the privileges required by the application. Many standard website applications require the normal application privileges for their own database.

Record the database name, database username and password securely. Depending on the server configuration, cPanel can automatically prefix database and user names with the cPanel username.

Enter the correct database details in your website application's configuration. On a typical cPanel account, applications hosted on the same server commonly use localhost as the database host, but always follow the application's and server's actual configuration.

Do not delete an existing database unless you are certain it is no longer required. Deleting the database can permanently remove website content and settings.

Before making destructive database changes, maintain a suitable backup. If a website stops working after a database change, note the exact application error and contact support if assistance is required.
Was this article helpful?