342: Finding your WordPress database name

When using the Softaculous tool to install your WordPress, a database name is created for you by default. Many people do not even notice this setting since it is already entered and therefore do not remember the database name. You may, however, need to recall this name later on, especially when troubleshooting or when you need to access the database. This quick guide will teach you how to find the database name for your WordPress installation.

How to locate your WordPress database name

  1. Log into your cPanel account.
  2. Next, using the File Manager tool, navigate to the root folder for your WordPress site. For most people, this is the same as their main domain, so the root folder will be public_html. If you are using an addon domain name, then it will be under public_html/addon-domain-name, and if your WordPress is in a subfolder, such as https://example.com/wp, then it will be in the public_html/wp folder. Note: Domains and subdomains can be in a different folder depending on you have set the root folder.  The public_html folder is the default location for published website files.
  3. Once in the correct folder, find the wp-config.php file. Highlight the file and open the file for editing.
  4. Once in the editor, you will see a lot of code regarding WordPress. Scroll through until you see the code for the database name. It looks similar to the like of code below:
    define(‘DB_NAME’, ‘userna5_wpusr1’);

    The database name is comprised of two individual parts. In our example here, the first part (userna5) is the cPanel username and the second part (_wpusr1) is the database name.

  5. Write your database name (the second part) down in a secure location so you will remember it when you need to access it using the phpMyAdmin database management tool.

Was this article helpful? Let us know!