Why You Might Need a Database
Many website applications — including popular platforms like WordPress and other content management systems — store their content in a MySQL database rather than in plain files. If you're installing this kind of software manually, you'll need to create a database, a database user, and connect the two before installation.
Creating a New Database
Log in to cPanel and find the Databases section, then click MySQL Databases. Under Create New Database, enter a name for your database and click Create Database. cPanel will usually add a prefix to the name automatically to keep it unique to your account, so take note of the full database name shown after it's created, since you'll need it later.
Creating a Database User
Scroll down to the MySQL Users section on the same page. Enter a username and a strong password, then click Create User. As with the database name, your username will typically have a prefix added automatically. Be sure to save the username and password somewhere safe, since you'll need both to connect your application to the database.
Linking the User to the Database
Having a database and a user isn't enough on its own — you need to grant that user access to that specific database. Scroll to the Add User to Database section, select the user and the database you just created from the dropdowns, and click Add. You'll then be asked to choose which privileges to grant; for most applications, selecting All Privileges is the simplest option unless you have a specific reason to limit access.
Using Your Database Details
Once everything is connected, you'll typically enter the database name, username, password, and a database host (usually localhost) into your application's installation or configuration settings. Double-check each value carefully, since a small typo in any of these fields is one of the most common reasons an installation fails to connect.
Managing Existing Databases
If you ever need to review, rename, or delete a database, you can do so from the same MySQL Databases page. Deleting a database is permanent and removes all the data stored in it, so always make sure you have a backup before removing one you're not certain about.