Login to your cPanel account and search for the File Manager to open, it happens to be under ‘Files’ section.
You will be re-directed on to a new page in to the Home Directory of your Account, you need to open public_html directory from the left hand side navigation menu as shown below.
Search for the wp-config.php file, which normally resides in the central area of your public_html folder. Right click on wp-config.php file and select Edit option.
It is important to notice that you need to authenticate before accessing the file, for which, you need to click Edit when a popup appears on the window.
You will be redirected to a new tab appears on your browser, and you can see a lot of coding lines. You need to find out something related to the database name, database password, etc.
Let me show you an example:
You can easily find all the Database details here i.e the Database Name, Username and password.
I hope you can easily acquire your Database details now.