Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Optimize the Database Tables of Your osCommerce Shop

This guide shows you how to tidy the database of your osCommerce shop so it can run faster.

Online Stores2 min read8 steps

What does "optimize" mean?

A database stores your shop data, like products and orders. It is split into tables. A table is like one page of a spreadsheet.

When you add and delete data, the tables get messy. They have gaps, like a bookshelf with books pulled out. Optimizing closes those gaps. The database becomes tidy and quick again.

Before you start

Take a backup of your database first. Optimizing is usually safe, but a backup protects you if something goes wrong. In phpMyAdmin, use the Export tab.

phpMyAdmin is a tool for looking at databases in your browser. It is in cPanel and Plesk.

Steps in phpMyAdmin

  1. Log in to your hosting control panel.
  2. Open phpMyAdmin.
  3. In the list on the left, click your osCommerce database.
  4. You will see a list of tables. Many start with osc_ or orders, products and so on.
  5. Tick the Check all box under the table list.
  6. Find the drop-down menu named With selected.
  7. Choose Optimize table.
  8. Wait for the result page. Each table should show an "OK" status.

If you do not know which database is yours, open the file includes/configure.php in your shop folder. Look for the line with DB_DATABASE. Do not change the file.

Using SQL instead

You can also run a command in the SQL tab. Replace the table names with yours.

OPTIMIZE TABLE orders, products, customers;

This command tidies the three tables named in it.

Tips for a healthy shop

  • Do this once a month, or after you delete many products or orders.
  • Do it when the shop is quiet. Tables may lock for a short time.
Tip: osCommerce is old software. Other shop tools use the same trick in phpMyAdmin, so these steps work for them as well.

Stuck? Open a support ticket.

Quick recap

  • Optimizing tidies the database tables.
  • Back up your database first.
  • In phpMyAdmin, select all tables and choose Optimize table.
  • Repeat it every month or so.