Errors in programs and databases can occur quickly and mysteriously. If something disasterous happens such as your admin account being deleted, it will seem imposible for your to fix as you need to get into the administrative area to troubleshoot or promote another user account to the Administrative role. In cases like this, you need to create an emergency admin account. This cannot be done through normal means and will need to be done with direct database interaction. Below is a guide on how to insert an admin account into your OpenCart 1.5 database.

  1. First, log into your cPanel account.
  2. From the main cPanel area, locate and find the Databases category, then click on the phpMyAdmin tool icon.
  3. Look to the left hand sidebar and click on the database name for your OpenCart installation. If you are unsure about the name, you can discover it by following these instructions.
  4. Once the database information loads into the right hand panel, look to the top tab menu, locate the SQL tab and click on it.
  5. Here is the SQL query editor. From here, we will enter some code that will create a new admin account for you. Below is the code to create a new admin account named admin123 and with the password admin.
    INSERT INTO oc_user VALUES
    (9999,1, 'admin123', '21232f297a57a5a743894a0e4a801fc3', '',
    'firstname', 'lastname', 'email@example.com', '',
    '0.0.0.0',1,CURDATE());
    Feel free to change the 'firstname', 'lastname', and 'email@example.com' data to anything you like as they should be obvious and are not crucial to getting you into the application. Do not change any of the other fields, however.
  6. Click on the Go button to activate the query and add the record.
  7. You will get a success message indicating the row was added. You can now test the user by logging into your OpenCart administrative area with the username admin123 and the password admin.
Continued Education in Course OpenCart
You are viewing Section 4: 346: How to add an Admin account in OpenCart via MySQL
Section 3: 347: Enabling email alerts within OpenCart 1.5
Section 5: 333: Adding a manufacturer to the banner in OpenCart
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!

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-09-22 6:14 pm

I added the prefix so to query the right table, but I still get an error saying "#1136 - Column count doesn't match value count at row 1".

Any ideas?

Staff
17,351 Points
2014-09-22 6:51 pm
Hello Dave,

Sorry for the problem. Can you provide us any account details (if you're a customer with InMotion), or can you provide any information on the installation - version of OpenCart, plugins, or themes. We need more information in order to investigate the issue.

Regards,
Arnel C.
n/a Points
2014-09-22 7:12 pm

Arnel, thanks for the quick reply. I'm not a InMotion customer, but just looking for someone that can help.

It's an Aceshop v1.4.6 installation (Opencart v1.5.1.3 within Joomla). I have a bunch of vqmod additions but didn't think they would matter for basic top admin access and the template is a standard opencart release.

I'm not sure what the cause was as I hadn't made any changes to permissions, but I found myself locked out. I reset the password via phpmyadmin, but am only able to access the dashboard and denied access to everything else. I'm not super familiar with opencart sql so am not quite sure what I'm doing when it comes to editing permissions.

Staff
9,162 Points
2014-09-22 7:26 pm
As this is not just a standard OpenCart installation, some things may not be the same as a typical OpenCart installation. Your best solution may be to contact the developer of Aceshop for more information on performing the changes that you need to make.
n/a Points
2014-09-22 7:29 pm

It was worth a shot. Thanks guys.

n/a Points
2014-10-08 2:29 am

I followed the instructions, recieved the all ok. Checked the DB and the user was there but the login and pass did not work. Anything else I can try? 

 

Staff
19,557 Points
2014-10-08 7:21 am
Hello John,

As long as you have access to the email address you inserted, you can just follow the instructions for the forgotten password link to have it change that. Then you should be able to get in.

Kindest Regards,
Scott M
n/a Points
2014-10-08 10:43 am

Thanks for the speedy response Scott, unfortuantely I have tried to reset my password. It says it works but it still refuses to let me log in. I have checked the database through phpMyAdmin and all seems ok, and yet I am still locked out. Is there anything else a person can try?

 

Staff
17,351 Points
2014-10-08 10:53 am
Hello John,

Sorry for the problems with the login. If you are unable to get your password working through the automated options, then you will need to contact live support. They can change it for you very quickly once your account information has been verified. You can reach live support through phone/email/chat .

Kindest regards,
Arnel C.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

9 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

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

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!