While working with any database driven program, there are bound to be times when you need to access the database directly. This is usually due to troubleshooting an error of some sort or doing some data investigation. To do this, you will need to know the exact name of the database, otherwise you could end up looking at the wrong data. Below are instructions to allow you to locate your database name for your OpenCart 1.5 site.
How to locate your OpenCart 1.5 database name
- Log into your cPanel dashboard.
- After gaining access to the cPanel main area, find and click on the File Manager.
- Once inside the File Manager, locate the root folder for your store. Most often, this is the root of the main domain, which would be the public_html folder. If you are using a subfolder such as store, the folder would be something like public_html/store.
- After entering the root folder, click on the folder named admin.
- Inside the admin folder, find and open the config.php file for editing.
- In the file editor you will see the code for a number of settings. Look for the line for the database name. It appears similar to the one below:
This line of code has the database name as the second parameter, userna5_ocdb123. This is actually two parts, the first part (userna5) is your cPanel username while the second part (ocdb123) is the actual database name you are looking for. Write down the database name so you can remember it when you work with the database.