Why do you need this?
WordPress keeps your posts, pages and settings in a database. A database is like a filing cabinet for your site's data. To back up, move or fix your site, you need to know which database it uses. WordPress stores these details in a file named wp-config.php. cPanel is the control panel for your hosting account, and it lets you open that file.
The four details
- DB_NAME: the name of the database.
- DB_USER: the user name that opens the database.
- DB_PASSWORD: the password for that user.
- DB_HOST: where the database lives. Often it is
localhost, which means the same server.
Steps
- Log in to your client area. Open your hosting service and log in to cPanel.
- Under Files, click File Manager.
- Open the folder where WordPress is installed. This is often
public_html. - Find the file
wp-config.php. - Right-click it and choose View. Choose Edit only if you plan to change it.
- Look near the top for lines like these:
define( 'DB_NAME', 'account_wp123' );
define( 'DB_USER', 'account_wpuser' );
define( 'DB_PASSWORD', 'your-password-here' );
define( 'DB_HOST', 'localhost' );
The words in the second box of each line are your values. Write them down.
Warning: Do not share this file or its password with anyone you do not trust. Take a backup before you edit it. One wrong character can break your site.
See the database in cPanel
- Go back to cPanel and click MySQL Databases.
- Scroll to Current Databases.
- Find the name you saw in
wp-config.php. It shows its linked user too.
DB_PASSWORD in wp-config.php to match. Both must be the same.If the site runs from a different folder, look in that folder instead. Need help? Open a support ticket.
Quick recap
- WordPress saves its database details in
wp-config.php. - Open it with File Manager in cPanel.
- Look for DB_NAME, DB_USER, DB_PASSWORD and DB_HOST.
- Back up before any edit.