Many websites — including every WordPress site — store their content in a MySQL database. If you're installing a CMS manually, or setting up a script that needs its own database, here's how to create one in cPanel.
Why you create "a database" and "a user"
Web hosts split these into two pieces for security:
- The database — where the data is stored.
- The user — a username and password used to reach the data.
- Privileges — the link that says "this user may access that database".
You create all three, then give your website the database name, username and password so it can connect.
den_wpdb. Whatever it shows is the exact name you must use later.How to create the database
- Log into cPanel.
- In the Databases section, click MySQL Databases.
- Under Create New Database, enter a name and click Create Database.
How to create the user
- On the same page, under Add New User, choose a username.
- Enter a strong password and click Create User.
How to attach the user to the database
- Under Add User to Database, pick your database and user from the dropdowns.
- Click Add.
- Tick ALL PRIVILEGES (or the specific privileges your app asks for) and click Make Changes.
Connect your website
Your application or install script will ask for four things — these all come from the steps above:
- Database name (with the cPanel prefix)
- Username (with the cPanel prefix)
- Password
- Host (usually
localhost— keep the default value the installer suggests)
Installing WordPress manually? See How to Connect a MySQL Database to WordPress for where these go.