Overview
WordPress and most modern web apps store data in MySQL. In cPanel you create:
- Database
- Database user
- User password
Then assign the user to the database with privileges.
Create database
1) cPanel → MySQL Databases
2) Create New Database → Create
Create user
1) MySQL Users → add user
2) Use a strong password
Assign user to database
1) Add User to Database
2) Select database and user
3) Grant ALL privileges (recommended for WordPress)
Using credentials
WordPress stores DB credentials in wp-config.php:
- DB_NAME
- DB_USER
- DB_PASSWORD
- DB_HOST (often localhost)
phpMyAdmin (advanced)
- Import/export databases
- Run queries
Use carefully and backup before major changes.
Common errors
“Error establishing a database connection”
- Wrong credentials in wp-config.php
- User not assigned to DB
- Incorrect DB_HOST
If you need help
Provide:
- Domain
- App type (WordPress/WooCommerce/etc.)
- Error text
- Whether this is new install or migration