Forgotten Your Admin Password? Shock, Horror!

By | March 3, 2008

Early releases of osCommerce didn’t have any protection for the Admin area – it was up to the Shop Owner to protect the Admin folder using .htaccess…easy enough in most hosts Control Panels. And easy enough to reset if you forgot the Password…

Jon sent in an interesting dilemma;

When I set up oscommerce the install asked me for a admin username and password, when I came back to the site a week later to do some work I cannot remember the Password that i used. Can you help?

RC (recent) releases of osCommerce include an inbuilt password – so the installation procedure asks for a Username and Password. If you forget your Password, it’s impossible to get it back, as it is entered into the MySQL Database encrypted.

BUT…it is easy to get around, so long as you have access to PHP My Admin (which is standard on just about every host that I know of!). Here’s what you need to do.

1. Open up PHP My Admin, and EMPTY the Administrators Table totally.

2. Go to your Shop Admin, and the login page will now ask you to set up a NEW admin username and password. It will show this text “No administrators exist in the database table. Please fill in the following information to create the first administrator. (A manual login is still required after this step)“. Obviously, you should follow this instruction!

3. You can now log in using your new username and password.

Easy as 123. Here’s a video I made of me doing exactly these steps;

15 thoughts on “Forgotten Your Admin Password? Shock, Horror!

  1. andy

    We have approx. 13 os stores. When going through the php my admin, only some of the os stores display a “administrators table”? Any thoughts/help?

  2. Gary Post author

    Andy – only newer oscommerce sites that use “RC” releases of osCommerce would have the administrators table. Older version would use standard .htaccess to secure the admin folder – so if you have cPanel (or similar hosting control panel) you’d set it up in that…

  3. andy

    we do have cpanel – please direct me if you would on how to change passwords for OS sites on the older versions.

  4. andy

    we do have cpanel – please help me if you would on how to change passwords for OS sites on the older versions via cpanel navigation.

  5. Gary Post author

    Andy – read your hosts help files or open a support ticket with them.

  6. Kevin

    Ahhhh exactly what I was looking for. There was another post showing a more complicated way of replacing the old password with a new one, this was 1 click and BAM..

    Thx!

  7. Andreas

    Excellent!!!

    Obviously it’s very simple! The video is really helpful

  8. Trev

    AArrgg.
    Just deleted the administrators table not the contents.
    What a twat.
    BUT had the foresight to export the table first so just looked at the contents in Textpad
    and manually repaired administrators table then able to input new name and password.
    Phew. Double phew.
    Anyway thanks Gary.
    But it had taught me how easy it is to change a DB structure and you should protect ANY access to the oscommerce DB rigorously.
    Cheers

  9. Gary Post author

    Trev – as you rightly say, it’s very easy for it all to go wrong when playing with the DB. Always, always, make a backup.

  10. Graham

    Thanks A million, iv been pulling my hair out for the past 2 hours. your a life saver

Leave a Reply

Your email address will not be published.