Most of the web-based scripts have their own
configuration file, where webmasters specify their host database information and how script(s) must behave in certain situations. In this tutorial, we will learn to identify your WordPress database name using wp-config.php file.
What you’ll need
Before you begin this guide you’ll need the following:
- Active hosting account
- WordPress installed on your hosting account
- cPanel’s File Manager access or FTP access with FTP client such as Filezilla
Table of Contents
Step 1 — Locating wp-config.php file
In order to locate wp-config.php file, you will first need to access your directory. For this, you can use either File Manager or external FTP Client.
- Here is a tutorial on how to access File Manager
- Here is a tutorial on how to access your directory via FTP client (FileZilla)
For File Manager
In File Manager, you should be able to see a number of various directories and files. We are looking for the specific file – wp-config.php. Its location entirely depends on where you have installed your WordPress script.
- If you installed it on your main website (main directory), then follow this path:
- If you installed it in a subfolder (addon domain, subdomain, etc.), follow this path:
- account_username is your cPanel username
- subfolder_name is the name of your specified subfolder.
For example, the next screenshot shows wp-config.php file location, if WordPress was installed in the main directory:
After successfully logging into your FTP account, you should be located in your host’s main directory, – either home or public_html. In either case, you will then need to navigate to your WordPress installation’s main folder, it could be either /home/public_html/ or /home/public_html/wp_folder (wp_folder is a name of a subfolder you were using for your WordPress installation).
For example, this screenshot shows the location of wp-config.php file when WordPress is installed in wp subfolder:
Step 2 — Acquiring database name from wp-config.php file
In order to open and review your wp-config.php file, you will need to right-click on it and go to either edit or view. This action is almost the same for both – FTP and File Manager.
Once inside, navigate to the value called DB_NAME (you may use a ctr+f combination in order to find it faster). In this case, the database name is
In this tutorial, we have learned how to access hosting account’s directory in order to review wp-config.php file’s contents. You can very similarly check for other database details there as well by looking up
DB_PASSWORD values since they all represent your actual WordPress database details.
This is one of the initial steps towards the greater understanding of WordPress setup and configuration.