The vast majority of settings and features can be handled within the WordPress Administration section. However, when troubleshooting or under extreme circumstances, you may need to work directly with the database. Most hosting accounts contain more than one database, so you will need to know exactly which database to work with. This article will demonstrate how to locate the database name your particular WordPress installation is working with.
How to Locate your WordPress Installation’s Database Name
- First, you will need to log into your cPanel account.
- Next, you will need to open and enter the File Manager tool.
- From the File Manager, you will need to locate and move to the root folder for your WordPress installation. If you are using your main domain, the root folder will be public_html. If you are using a domain name, then it will be under public_html/domainname (For example, if example.com is an addon domain, you will need to fin the public_html/example.com folder)
- Once in the root folder for your application, you will see many files. The find the wp-config.php file. Highlight the file and then click on the Edit button found in the toolbar across the top of the screen. A popup will appear on the screen, click the Edit button there as well.
- Once in the editor, you will see a lot of code regarding WordPress. Just past the code comments, around line 19, you will see the code for the database name. It appears like the example below:
define('DB_NAME', 'userna5_wp123');
The database name parameter is actually composed of two parts. In our example userna5
_wp123
, the first part is the cPanel username (userna5
), and the second part is the actual database name (_wp123
)
- Write down your database name in a secure location so you can remember it when you need to access it using the phpMyAdmin database management tool.
Shared hosting users needing more databases can upgrade their Shared hosting plan size within Account Management Panel (AMP) or consider a VPS hosting plan.