Most web applications, including WordPress, store their content in a MySQL database. cPanel lets you create a database, a database user, and link the two without using the command line.
Create the Database
- In cPanel, open MySQL Databases under the Databases section.
- Under Create New Database, type a name. cPanel adds a prefix based on your account, so the full name looks like
cpuser_appdb. - Click Create Database, then click Go Back.
Write down the full database name including the prefix, you will need it later.
Create a Database User
- Scroll to MySQL Users and find Add New User.
- Enter a username and use the password generator for a strong password.
- Click Create User and save the credentials securely.
Assign the User to the Database
A user can only access a database after it is added to it.
- Under Add User To Database, pick your user and database from the dropdowns.
- Click Add.
- On the privileges screen, tick ALL PRIVILEGES, then click Make Changes.
Connection Details
When your application asks for database settings, use these values:
| Setting | Value | |----------|--------------------------------| | Host | localhost | | Database | cpuser_appdb (your full name) | | Username | cpuser_dbuser (with prefix) | | Password | the one you created |
The host is almost always localhost on shared hosting, not your domain or an IP address. If a connection fails, double-check that the user was actually assigned to the database and that the prefix is included in both the database and username.