0
Magento 1.9.1
Porto theme

I have had a problem twice before where I could not log into the Magento Admin panel with my user name and password. I had to use code in the mySQL to change the password for my Admin user account.

This actually started a couple of hours ago. We have 3 Active accounts:

1 (mine) with the Admin privileges and 2 with a specific defined User roles.

The 2 accounts with specific defined User roles lost access first; then I went to the User's area in the Admin panel and found that those 2 accounts were set to DISABLED instead of Enabled. I created a new user account so that I could give it to the other 2 people but shortly after I did that - I was logged off from the Admin panel and was never able to log back in. The new user account I created does NOT work either.

I tried to run the following command in the SQL tab of the correct database via mySQL:

UPDATE mg_admin_user SET password = md5('test'), is_active = 1 WHERE username = 'Allysin'

but it just says that it took something like 0.003 seconds and there were no rows to update.

The interesting things is that when I open up the rows of the database and look at:

mg_admin_role

It actually has all the roles I defined before in it!

But when I open up the 'mg_admin_user' --) it is empty.

What do you think happened? Did somebody hack us and deleted all the user accounts?

How can I fix it? Is there a way to add a user account back into the database? Or is there something else I'm missing?

1 Answer 1

0

If the database is still intact & your familiar with using the command line, I'd try using n98-magerun:

https://github.com/netz98/n98-magerun

download it, then just use the admin:user:create feature, that'll at least get you back into the system.

2
  • Thank you for that. I do have shell access but this seems a bit complicated...How does one install it? Just copy the file over via FTP and then how do you call up the admin:user:create feature?
    – Allysin
    Sep 5, 2018 at 17:35
  • @Allysin - you download the file to your Magento docroot, use chmod +x [filename] and then you should be able to run ./n98-magerun.phar list and it will give you all the available commands, including admin:user:create, you can also run ./n98-magerun admin:user:create --help for an explanation of the command.
    – dbcn
    Sep 5, 2018 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.