OpenCart Admin Account from database

Here is how you can add an admin account to your Opencart 2.X store using phpMyAdmin/MySQL database. This guide would come handy if you are unable to add the administrator account from the OpenCart panel, or have forgotten your password. Also helpful if you’re an agency/developer and the customer hasn’t given you administrator access. If you feel your store has been hacked and that is why you are not able to access the dashboard, check critical signs of hacked websites.

  1. Log into your cPanel account/hosting administrator dashboard.
  2. In the cPanel main page, find the Databases category, and click on the phpMyAdmin tool icon.
  3. From the left sidebar, select the database name of your OpenCart installation. If you do not remember the name of your database, open the config.php which is in the root of your server and see the value of the variable DB_DATABASE.
  4. Once you open the correct database, click on the “SQL” tab at the top.
  5. Now enter the following SQL command in the SQL query editor. This query will create a new administrator account to the OpenCart store.Opencart 2.X Admin User Table - phpMyAdmin
    (9999,1, ‘Username‘, MD5(‘admin_password’), ”, ‘FirstName‘, ‘LastName‘, ‘‘, ”, ”, ‘’,1,CURDATE());

    If you want to change the details of the user, modify the values in ‘FirstName‘, ‘LastName‘, and ‘‘.

  6. Click on the Go button to run the query and add the new admin user in the database.
  7. You should now see the ‘successful query’ message, navigate to your OpenCart admin area and try logging in with the following user credentials:
    • Username: admin_user
    • Password: admin_password
  8. Once you login to the dashboard, immediately change your account password.

Popular CMSs like OpenCart are often targeted by hackers. To ensure utmost OpenCart Security, use Astra Security suite to protect your store and block hackers. Astra comes with a bulletproof Web Application Firewall (WAF), malware scanning, bad bot blocking and much more. See the list of all features here.

Was this post helpful?

This Blog Includes hide

Waiting to Get Hacked?

Get security tips & latest vulnerability fixes right in your inbox:

About The Author

Ananda Krishna

Ananda Krishna is the co-founder & CTO of Astra Security, a SaaS suite that secures businesses from cyber threats. He has been acknowledged by the Indian Navy, Microsoft, United Airlines, etc. for finding critical security vulnerabilities in their systems. Winner of the Best Security Product at Global Conference on Cyberspace 2017 (awarded by Narendra Modi, Prime Minister of India) & French Tech Ticket, Paris (awarded by François Hollande, former President of France). At Astra he's building an intelligent security ecosystem - web application firewall (WAF), malware detection & analysis, large scale SaaS applications, APIs & more. He's actively involved in the cyber security community and shared his knowledge at various forums & invited talks.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.