Hello,
Accidently disabled admin user. I can't login to admin site now. How can I find the file to re-create admin user login user ID and password?
Thanks in advance!
Accidently disabled admin user. I can't login to admin site now. How can I find the file to re-create admin user login user ID and password?
Thanks in advance!
Last edited by harap on Tue Oct 03, 2023 11:44 pm, edited 1 time in total.
LOGIN TO >> phpMyAdmin
Select your database XX_xXxXxXxX — Primary database for this environment
Select the oc_users table (If you have a custom database prefix this will be yourprefix_users.)
user_status — Set this to 1
Update : 1 to enable that user. 0 to disabled.
Click Go at the bottom
Click Go again on the query page
You should get a green check mark and success banner.
Select your database XX_xXxXxXxX — Primary database for this environment
Select the oc_users table (If you have a custom database prefix this will be yourprefix_users.)
user_status — Set this to 1
Update : 1 to enable that user. 0 to disabled.
Click Go at the bottom
Click Go again on the query page
You should get a green check mark and success banner.
Last edited by WaxedPerfection on Tue Oct 03, 2023 3:29 pm, edited 1 time in total.
https://www.waxedperfection.co.uk/ Car Detailing Product Blog's and Review's
The status column should be set to 1 to enable that user. 0 will equate to disabled.
In admin site user setting, accidently clicked the disable button and saved the admin user. The nightmare begins, the admin site becomes inaccessible. Tried to recover it in oc_user from database, but the issue persists.Can you give details? Just how exactly did you disable the admin user?
Sorry that was a typo on my side it should have been one, as above. sorry again
https://www.waxedperfection.co.uk/ Car Detailing Product Blog's and Review's
What message do you get when you try to login? Have you checked both your OpenCart and PHP error logs? What version of OpenCart are you using?
Could you password have been changed when you edited the user?
Could you password have been changed when you edited the user?
Check your oc_user from cpanel backup.
View all extensions | Request custom work | Pricing | Contact Me
I'm using OC v4.0.2.3 and running PHP8.1. Unable to login Admin site always show "No match for Username and/or Password.".ADD Creative wrote: ↑Tue Oct 03, 2023 4:11 pmWhat message do you get when you try to login? Have you checked both your OpenCart and PHP error logs? What version of OpenCart are you using?
Could you password have been changed when you edited the user?
I can see error log /storage folder from cPanel:
----------------------------------------------------------------------------
2023-10-01 00:01:33 - Call to undefined function Opencart\System\Helper\Utf8\strlen() in /home/SorryHided/SorryHidedmysite/catalog/controller/product/askquestion.php on line 65
2023-10-01 07:38:06 - 0: Error: Table 'test.oc_user_history' doesn't exist<br/>Error No: 1146<br/>DELETE FROM `oc_user_history` WHERE `user_id` = '1'
File: /home/SorryHided/SorryHidedmysite/system/library/db/mysqli.php
Line: 76
2023-10-01 07:38:22 - 0: Error: Table 'test.oc_user_history' doesn't exist<br/>Error No: 1146<br/>DELETE FROM `oc_user_history` WHERE `user_id` = '1'
File: /home/SorryHided/SorryHidedmysite/system/library/db/mysqli.php
Line: 76
--------------------------------------------------------------------------------
The site no cPanel backup yet because this is a new staging test site.
Those errors would occur if you had deleted a user. Check you user entry in the database is still there.
Have you tried resetting your password?
You can do this in the database. Make a backup of your database first. Goto the oc_user table in phpMyAdmin and edit the row you want to change. On the password row select MD5 as the function from the drop down. Change the value to a new password. Login to admin using the new password.
Once logged in change the password again for that user in the admin. This will ensure it will be hashed correctly.
Or you could just run a SQL query for a selected user_id.
Have you tried resetting your password?
You can do this in the database. Make a backup of your database first. Goto the oc_user table in phpMyAdmin and edit the row you want to change. On the password row select MD5 as the function from the drop down. Change the value to a new password. Login to admin using the new password.
Once logged in change the password again for that user in the admin. This will ensure it will be hashed correctly.
Or you could just run a SQL query for a selected user_id.
Code: Select all
UPDATE `oc_user` SET `password` = md5('password123') WHERE `user_id` = 1
Yes, Thank you very much for the help. Select MD5 function for the password solved the problem. Owe you a Starbucks.ADD Creative wrote: ↑Tue Oct 03, 2023 11:24 pmThose errors would occur if you had deleted a user. Check you user entry in the database is still there.
Have you tried resetting your password?
You can do this in the database. Make a backup of your database first. Goto the oc_user table in phpMyAdmin and edit the row you want to change. On the password row select MD5 as the function from the drop down. Change the value to a new password. Login to admin using the new password.
Once logged in change the password again for that user in the admin. This will ensure it will be hashed correctly.
Thank you all.
Cheer!
Who is online
Users browsing this forum: No registered users and 3 guests