Cantech Knowledge Base

Your Go-To Hosting Resource

How To Find The Database Details Of Your WordPress In cPanel?

To effectively manage a WordPress site, it helps to understand the underlying database that powers your site. Knowing your WordPress database details can be very helpful, whether you are researching an error, migrating your website, or doing regular maintenance.

Have you ever run into the dreaded message – “Error Establishing a Database Connection?” Or, perhaps you are planning on wanting to migrate your site to a new host? If you ever find yourself in either of these two situations, it’s always useful to have fast access to your database credentials.

In this blog, we will walk you step by step through how to find your WordPress database details using cPanel. This blog will be useful whether you are a beginner just learning how to manage websites or an experienced website manager. Let’s get started!

Importance of Your WordPress Database Information

Every WordPress website depends on its database to manage and store the important data that the site runs on such as posts, comments, user accounts, settings, etc. You may need to locate your database information for reasons such as:

1. Database Access to Troubleshoot

Your website can show errors that have to do with database access. If you need to check the database’s connection, you need the database information to verify or change your credentials. Database details are often the easiest way to quickly get to the root of your connection issues.

2. Manual Backup and Restore

Plugin backups are great (and highly recommended) but doing backups manually gives you more knowledge and control over the backup process. Understanding what your database information is gives you the knowledge and ability to back the site up manually as well as restore it if necessary.

3. Site Migration

When you are migrating your WordPress site to a new hosting provider, you will need access to your database. Understanding the database information allows you to properly and easily transfer your information.

4. Optimization and Maintenance

Periodically cleaning your database and optimizing the tables is a part of having a fast and efficient website. To do that, you will need the database information to access those tables found in phpMyAdmin.

Essentials to Find Your Database Details

Before you begin finding your database information, please have the following things ready for this process:
Access to your Cpanel account.
Install WordPress on your hosting server.
Basic understanding of cPanel’s file manager and phpMyAdmin.

tep-by-Step Guide to Finding Database Details

Let’s break down the process into easy-to-follow steps:

Step 1: Log in to cPanel Account

Access your cPanel account by inputting the URL of your domain followed by “/cpanel” or through your hosting provider’s account link. Enter your username and password to log in.

Step 2: Find the File Manager

After you log in, go to the Files section and click on File Manager. It will allow you to access the files your website is using.

Step 3: Access the Root Directory

On the left hand side of the window, you will want to open the public_html folder. This is often the root directory of where your website’s files are stored.

Step 4: Locate wp-config.php

Locate wp-config.php, and this file will contain all your WordPress database info. You will find wp-config.php be located under public_html, or may be nested under a subfolder of that if WordPress is installed in a subfolder.

Step 5: Open the wp-config.php File

From the left side menu, right-click on wp-config.php and select “View” or “Edit.” This will show the file components in a text editor.Within the file, you will want to look for lines that read something similar to:

define(‘DB_NAME’, ‘your_database_name’);
define(‘DB_USER’, ‘your_database_user’);
define(‘DB_PASSWORD’, ‘your_database_password’);
define(‘DB_HOST’, ‘localhost’);

The lines provide the following information:
Database Name (DB_NAME): This indicates the name of your WordPress database.
Database User (DB_USER): This indicates what username you use to connect to the database.
Database Password (DB_PASSWORD): This indicates what the password is, for your database username.
Database Host (DB_HOST): This indicates the server your database is located on (usually localhost, typically).

Step 6: Open phpMyAdmin

Go back to the main cPanel page and find phpMyAdmin in the Databases section. Click on phpMyAdmin to bring up the database management interface.

Step 7: Choose Your Database

Once the phpMyAdmin dashboard loads, you will locate your database in the left-hand sidebar of the phpMyAdmin interface. Once you find it, click on it again in the left-hand sidebar, and you should see a list of tables that correspond to your WordPress site in the right-side window.

Step 8: Browse The Database Tables

You can browse the tables, (for instance, wp_users, wp_posts, wp_options), you should be able to see information and even modify that information with some caution, depending on what you want to accomplish.

Tips for Managing Your WordPress Database

Backup Regularly
Always backup your database before you make any changes. This can be done via plugins or by exporting your database using phpMyAdmin.

Use Proper Credentials
Don’t use weak usernames and passwords to access your database, use secure access to prevent theft and unauthorized access.

Limit access to phpMyAdmin
Control who has access to the database. It is important you limit who can access your database for security reasons.

Optimize your Database
Clean up unused data, and optimize your database tables often to help your site function well.

Common Issues and Troubleshooting

Error establishing a database connection
This usually is a result of incorrect credentials inside wp-config.php so double check your database name, user, and password.

Access denied from phpMyAdmin
If you can’t get into phpMyAdmin, try checking and making sure you have the right credentials in your cPanel, or maybe you need to update your permissions for the database user.

Corrupt wp-config.php file
If you accidentally updated or somehow corrupt your wp-config.php file, you can restore it from backup, or try to carefully edit it and correct the errors.

Conclusion

It is very helpful to know your WordPress database information for troubleshooting, migration or maintenance. With the step-by-step instructions, you will be able to find important database information in cPanel. Through regular database management and securing users, you will have a stable and effective site.

Frequently Asked Questions

Can I change the database information in cPanel?
Yes, to do that, either modify the database information located within the wp-config.php file, or create a new user for your MySQL Databases.

What if I change the wp-config.php file accidentally?
You will have to restore the file from a backup, or if you know what the text originally was, you can manually change the syntax.

How do I protect my WordPress database passwords?
Make sure to use strong, complex passwords and limit access to cPanel.

Can I also use plugins to find database information instead?
Yes, plugins such as WP-Config File Editor can display database information from your dashboard.

June 13, 2025