Finding your OpenCart database name

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

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:

define('DB_DATABASE', 'userna5_ocdb123');

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.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)

The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.

How did you find this article?

Please tell us how we can improve this article:

Email Address

Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!