3

Is there a way to change Magento back-end login and password using just cPanel and PHPMyAdmin? I cannot reset the password and if I attempt to reset the password It will email the developer who tried to screw me over. I now have a website I cannot log into. Any help will be greatly appreciated. Thanks.

---Update

So I changed it but I still unable to login > See pic. Is there something I'm missing?

enter image description here

  • do u have atleast username for admin login ? – Pradeep Sanku Jan 9 '15 at 17:10
  • try my code it will work – Pradeep Sanku Jan 9 '15 at 17:47
  • yes login is admin, but I do not have anything else. Shouldn't that phpmyadmin update fix things? I don't know why it's not working could it be the Extra Data? some kind of encryption there? – Homero Miranda Jan 9 '15 at 17:50
4

I've not really used PHPMyAdmin, but you should be able to do something like the following:

UPDATE admin_user SET password = md5('password0123') WHERE username = 'username';

  • which line do you go to? admin_assert? admin_user? Could you please provide more precise instruction sir? – Homero Miranda Jan 9 '15 at 17:31
  • 1
    got it:) it's in admin_user – Homero Miranda Jan 9 '15 at 17:33
  • Looked at your picture, the password should be wrapped in the md5 function like md5('password') before being input. Such that the password looks like random gibberish. Go to the following URL to generate a MD5 of your password miraclesalad.com/webtools/md5.php – Luke Rodgers Jan 9 '15 at 18:01
1

@Pradeep Sanku

i can't comment for lack of reputation but you need to remove a semicolon from the end of the setpassword line on your solution:

<?php
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

Mage::getModel('admin/user')
->loadByUsername('admin')
->setPassword("yournewpassword")
->save();

echo "Successfully Changed";
?>

I tried both the query solution and the php one but I still get access denied :(

  • I fixed the syntax error in @PradeepSanku's answer, thank you – Fabian Schmengler Jul 4 '17 at 17:28
1

if you have access to the ftp.you can create php file with following code

<?php
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

Mage::getModel('admin/user')
->loadByUsername('admin')
->setPassword("yournewpassword")
->save();

echo "Successfully Changed";
?>

and place this file at magento root directory (where you will see your index.php) and run this file using http://www.urlofwebsite.com/resetpassword.php

  • I don't need to create a new account. Block the old login and provide one for myself in the backend. Thank you:) – Homero Miranda Jan 9 '15 at 17:48
  • it is not creating new login.it is loading the account and changing the password that it.which block the old password.believe me – Pradeep Sanku Jan 9 '15 at 17:49
  • Ok:) I believe you. where do I place this php? Could you be more specific sir. – Homero Miranda Jan 9 '15 at 17:51
  • at you root dir .it is the same place where you have your (app,skin,media etc folder) at this level. – Pradeep Sanku Jan 9 '15 at 17:55
  • hm, mysql cli or phpmyadmin is much faster and safer. all you have to do just forget this file, and guess what, any bot will find it right away... – user2857 Jan 10 '15 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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