When working with programs such as OpenCart, strange things can happen. At times, even unexplainable incidents such as disappearing admin accounts can occur. While this is a rare occurrence, and usually due to an accident while playing with the database, it can play havoc when trying to fix the issue. You would need to access the admin area to create or promote an account to the admin role. However, without an account to access the admin area, you are stuck. You need to have a plan for inserting an emergency admin account into your OpenCart application database. Below are the instructions for doing just that.

How to create an emergency admin account in OpenCart

  1. To begin, you will need to access your cPanel account.
  2. Entering at the cPanel main area, you will want to find the Databases category and then click on the phpMyAdmin tool icon.
  3. Once inside, look to the list of databases on the left. Find and click on the database for your OpenCart application. If you do not know which database is the one to use, you can find out using our article: Finding your OpenCart database name.
  4. Clicking on the database name brings up the specific information in the right hand panel. Across the top are several tabs, click on the SQL tab.
  5. This brings up the SQL query editor where we will enter the code to create an admin account in the database. Below is the code you want to cut and paste into the query editor:

    INSERT INTO oc_user VALUES
    (9999,1, 'admin123', '21232f297a57a5a743894a0e4a801fc3', '',
    'firstname', 'lastname', ' This email address is being protected from spambots. You need JavaScript enabled to view it. ', '',
    '0.0.0.0',1,CURDATE());

    Although you can edit the fields with 'firstname','lastname', and ' This email address is being protected from spambots. You need JavaScript enabled to view it. ' to be real names and email, do not edit any other fields. Click GO at the lower right corner to run the code and add it to the database.
  6. You will see a success message once the process is complete. You can now log into the admin area of your OpenCart with the username 'admin123' and the password 'admin'.

 

Did you find this article helpful?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

The Community Support team wrote the article you're looking at now. We like to think it's perfect, but we're sure you have some suggestions. Please, let us know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Have a Question?

If you need some help, submit your question to our Community! We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)

Recent Questions

  1. Site under brute force attack
  2. URLs in Installation of WordPress Don't Redirect
  3. Choosing a Directory With WordPress

Support Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.