Step 1: Log into your cPanel account.
Step 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.
Step 3:Once in the correct folder, find the wp-config.php file. Highlight the file and open the file for editing.
Step 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.
Step 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.