339: How to reset my OpenCart Admin Password

It can be hard to keep up with all the different passwords for your account. If you’ve forgot your admin password for OpenCart, you can reset the password in the database. You’ll have to use phpMyAdmin in cPanel to change the password to the admin account.

How to change your OpenCart Password in phpMyAdmin

  1. Log into cPanel and click on phpMyAdmin
  2. Open the database that your OpenCart store uses
  3. OpenCart User Table

    Find the “user” table and then click on Edit, next to your “admin” user entry.

  4. OpenCart Admin Password Change

    Write your preferred password in the password field. From the function dropdown to the left, select MD5. Press Go at the bottom to save your settings.

  5. Now, attempt to log into the OpenCart Dashboard with your new password

If you need further assistance please feel free to ask a question on our support center.

To find out more on using InMotion’s web hosting solutions for OpenCart, click on OpenCart Hosting with InMotion.

Thoughts on “339: How to reset my OpenCart Admin Password

  • Good day . pls i try the reset stuff and using password i was able to login . But once i click on anything in the website , this is what i got .

    The page you requested cannot be found!

    The page you requested cannot be found.

    I can view but i cant click on anything on my website . pls help

     

    • I recommend renaming the .htaccess file that is in the main directory for your OpenCart installation. It seems like your links are corrupted and that file does generally control the links. If that does not resolve the issue then you can always rename it back. However, at that point, you may want to restore the website using a working backup.

  • My username is not”admin”
    And i did whatever is mention in this article to change it to “password”
    but it seems that nothing is working.
    Please help me.
    Regards

    • Hi SAndy,

      So, if you followed the steps, you’d simply edit the user with the username you are attempting to access instead of the “admin” user. If its still not working, I’d suggest reaching out to the Support Department and they can help you reset your password. Thanks!

      Tim S

  • I have followed the article down to the letter. I cannot get this to work. Opencart Version is 2.0.2.0.

    Please anyone, I am in desperate need, my “client” is going to kill me.

    Thanks for any assistance

    • Hello Tobie,

      The change password options above were more designed for the pre-2.x versions of OpenCart. You should be able to find the email address of the Administrator in the database. We would suggest emailing it and see if if you can recover the database using the recover password option available through the email address of the administrator.

      I hope this helps to answer your question, please let us know if you require any further assistance.

      Regards,
      Arnel C.

  • i am trying to change password through email reset link. i am getting the email with link, when i click the link it does not take me give me the reset option but take me back to the login screen. i was wondering if someone can guide as to where is the issue.

    • Hello Riaz,

      I regret to hear you’re having trouble with that link. Were you able to reset your password directly through the database as the article suggests?

  • Hi Scott,

    As you suggested, I used HeidiSQL, but it gives me this error:

    Access denied for user ‘lecoccol_shop’@’94.205.211.76’ (using password: YES)

    What should I do to fix it?

    Thanks

    • Manuela, you need to check the SQL username and password you are using. Also check to verify the user has privileges on the database so that specific user can access it.

  • Hi Arnel, 

    Thank you for responding. What lead me to this conversation was me trying to find any way to log back into my opencart account because the Lost Password link that is suppose to be below the login, was not there. Up to now, it doesnt seem to exist on my website. 

    I believe something or some updates have ultered my .php but I do not know which is causing all these changes to my backend site. I am tempted to delete the whole site and start all over again. 

    As much as I really dont want to, any help that can be provide will truly appreciate it. 

     Here is the link for you to see that the Lost Password link doesnt exist on the page. 

    http://sadeskincare.com/admin/

    • Hello Sam,

      Thank you for contacting us. As a test, try renaming your .htaccess file (for example to .htaccess.old) and accessing the password reset page directly here:
      http://example.com/index.php?route=account/forgotten (be sure to replace example.com with your actual domain name)

      This will rule out if a .htaccess rule is interfering with your password reset page.

      Thank you,
      John-Paul

  • Hello there, 

    Thank you for sharing. It worked but after making that changes. I was not able to update anything on the site. Every little changes I make in the backend and click save. I get this as a result. (Forbidden You don’t have permission to access /admin/index.php on this server.)  

    I even tried changing the permissions to the index.php files both in the public.html and admin folder and still doesnt work. 

    Please help. 

    Thank you.

    • Hello Sam,

      Apologies for the problem with the password reset. Depending on the versions, this may have changed, so it may be in your best interest to change the password using the Lost password option provided by OpenCart. If you do not know the user/email address, you can access the database to find it out or change it and then run the lost password application in order to properly recover it.

      I hope this helps to answer your question, please let us know if you require any further assistance.

      Regards,
      Arnel C.

  • Hello there, 

    Thank you for sharing. It worked but after making that changes. I was not able to update anything on the site. Every little changes I make in the backend and click save. I get this as a result. (

    Forbidden

    You don’t have permission to access /admin/index.php on this server.) 

     

    I even tried changing the permissions to the index.php files both in the public.html and admin folder and still doesnt work. 

    Please help. 

    Thank you.

  • Hello Scott,

    Thank you for your help, there was some issue in config file, issue is restored now.

    Thank you so much for your help, God bless you.

  • Hello Edens,

    You were right sir, there was some issue, what i did is, i copied config file from old hosting server and past on new server and changed link path & db details..now i am able to browse the site, but facing 2 new problem.

    1) http://www.flexnflex.com/newsite unable to add any item on cart..show error when try to add any product. 

    2) unable to access admin portal, when trying to login with same access which i used on old hosting but not working, so i changed password from phpmyadmin, but still unable to login in admin panel.

    Your help would be highly appreciated. Please help me.

    Thank you

    • Hello Khan,

      When you try to add products, are you getting any error messages?

      If the password change via the phpmyadmin did not work, try using the Forgotten Password link. Changing in this way is more reliable than doing it directly in the database.

      Kindest Regards,
      Scott M

    • Hello Khan,

      Please view the file at /home/flexnflex/flexnflex.com/newsite/config.php and check the lines around 23. Look for any coding that is either missing a semi-colon or added parentheses. Also you could display the information here and we can take a look if you do not find it. However I would suggest to remove any sensitive information so it would not be public.

      Best Regards,
      TJ Edens

    • Hello Manuela,

      You will want to test your database connection using an external tool such as HeidiSQL. The test is to see if you can connect using the same connection information (db user, db name, password, etc).

      If that works, then the error lies somewhere in the OpenCart setup. If it fails, then you will need to check and ensure which settings are incorrect.

      Kindest Regards,
      Scott M

  • Hi

    I am getting error message while try to log in-

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘lecoccol_shop’@’localhost’ (using password: YES) in /home/lecoccol/public_html/shop/system/database/mysql.php on line 6

    Notice: Error: Could not make a database link using lecoccol_shop@localhost in /home/lecoccol/public_html/shop/system/database/mysql.php on line 7

    Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/lecoccol/public_html/shop/system/database/mysql.php on line 10

    Notice: Error: Could not connect to database lecoccol_shop in /home/lecoccol/public_html/shop/system/database/mysql.php on line 11

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/lecoccol/public_html/shop/system/database/mysql.php on line 14

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/lecoccol/public_html/shop/system/database/mysql.php on line 15

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/lecoccol/public_html/shop/system/database/mysql.php on line 16

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/lecoccol/public_html/shop/system/database/mysql.php on line 17

    Notice: Trying to get property of non-object in /home/lecoccol/public_html/shop/admin/index.php on line 47

    Warning: Invalid argument supplied for foreach() in /home/lecoccol/public_html/shop/admin/index.php on line 47

    I change the config.php file with data from the database:

     

    // DB

    define ('DB_DRIVER', 'mysql');

    define ('DB_HOSTNAME', 'localhost');

    define ('DB_USERNAME', 'admin');

    define ('DB_PASSWORD', 'password');

    define ('DB_DATABASE', 'lecoccol_shop');

    define ('DB_Prefix', 'lecoccol_');

    ?>

    And now what do I do?

    • It’s appears you have not changed out the information for the database to connect properly. Make sure you use the correct information for the “DB_USERNAME, DB_PASSWORD, and DD_DATABASE”

    • Hello book,

      Thank you for contacting us. It is possible that errors are being suppressed. Turning on error reporting in OpenCart may provide a more detailed message.

      We are happy to help further, but will need some additional information.

      What version of OpenCart are you using?

      What Themes, and 3rd party addons do you have installed?

      Thank you,
      John-Paul

  • Hi

    I am getting error message while try to log in-

    Notice: unserialize(): Error at offset 90 of 65535 bytes in /home/rubsanji/public_html/muslimbd.com/admin/index.php on line 41
    Warning: session_start(): Cannot send session cookie – headers already sent by (output started at /home/rubsanji/public_html/muslimbd.com/admin/index.php:41) in /home/rubsanji/public_html/muslimbd.com/system/library/session.php on line 12Warning: session_start(): Cannot send session cache limiter – headers already sent (output started at /home/rubsanji/public_html/muslimbd.com/admin/index.php:41) in /home/rubsanji/public_html/muslimbd.com/system/library/session.php on line 12Warning: Cannot modify header information – headers already sent by (output started at /home/rubsanji/public_html/muslimbd.com/admin/index.php:41) in /home/rubsanji/public_html/muslimbd.com/system/library/response.php on line 12

     

    What to do. I am not expert in php od mysql to set up this issue.

    best regerds

    Dr sharear azam

    • Hello Dr sharear,

      Did you make any changes to files or settings prior to getting this message? Have you change your PHP version? Did you always get this message? If not when did it start?

      Best Regards,
      TJ Edens

  • It didnt work for me. Thanks a lot for suport my previous problem. Now its a big issue for me 5 hours trying to recover my password. when i updated password it says-

    1 row affected.

    UPDATE `b4_15536624_muslimbd`.`oc_user` SET `user_id` = '1',
    `user_group_id` = '1',
    `password` = '5f4dcc3b5aa765d61d8327deb882cf99' WHERE `oc_user`.`user_id` =0;

    i need urgent support please.

    • If you have more than one database, be sure that you are editing the correct database. Also, check your username to ensure that is correct as well.

  • I followed the steps through altering the database and entering the password

     

    5f4dcc3b5aa765d61d8327deb882cf99

    it does not work!

    • Hello Jaqueline,

      I tested a fresh installation and the code 5f4dcc3b5aa765d61d8327deb882cf99 worked for me and I was able to log into the admin area with the password of ‘password‘. Please make sure that you are not setting the field to MD5 and that you do not have any extraneous spaces either before or after the code you enter.

      Kindest Regards,
      Scott M

  • Have the same issue. Also did not work. Suprisingly I was password written when I created it, but it still says that password is incorrect…

    • Hello Jelena,

      Sorry to hear about the problems that you’re having with the password. However, this article does give you the steps to manually change your password using phpMyAdmin in cPanel. If you don’t have an account through InMotion, then you would need to use a database client in order to access the database to edit the existing password.

      If you require further assistance, please provide us account information or at least the version of OpenCart that you’re using.

      Kindest regards,
      Arnel C.

  • Jacob-

    please help!

    I have done everything I can possibly think of… editing php is not resetting/defaulting password. i cannot for the life of me understand why I cant log into admin. Please any help!!!

    • Be sure that you are entering the correct information within the correct database. If you continue to have issues, I recommend contacting support in which they will be able to make changes for you if needed.

Leave a Reply to Brian Cancel reply