Magento – How to Reset the Admin Password

Posted by Antonio David | Posted in Tutorials | Posted on 11-03-2010

Tags: , , , , , , , , , ,

1

You are locked out of your Magento site’s Admin Panel.  You’ve tried every username/password combination you know and have searched your entire computer (inside and out) for a file or sticky note to no avail.  Don’t worry, all is not lost — that is, assuming you have access and permission to browse and modify the database.

Access to the database is typically done through:

  • phpMyAdmin – a 3rd party utility that usually comes packaged with hosting accounts (whether dedicated, shared, cloud, etc.)
  • SSH – a command-line interface

Let’s say for example we’ve lost the password for the account with username: testadmin.

Using phpMyAdmin

1. In the left-hand column, click on the table called “admin_user“.

Open admin_user Table

2. Click the “Browse” tab found at the top (horizontal) menu.

Browse table

3. Locate the account you wish to modify (testuser in this example), and click on the “Edit” icon (to the left of “Delete” and looks like a pencil)

Locate account

4. Locate the “password” row.  Select “MD5” from the dropdown menu and type in the new password.

Select MD5 and type new password

5. Scroll to the bottom and click “Go” — and you should be all set!

Using SSH

1. Log in to the mysql> prompt using:

mysql -u [dbUsername] -p[dbPassword] -h[dbHost] [databaseName]

For more information on this, see: Accessing MySQL via SSH

2. You should now see that your command prompt now looks like:

mysql>

3. Enter the command:

UPDATE admin_user SET password = MD5('OurNewPassword') WHERE username = 'testuser';

4. Hit Enter on your keyboard and you are done.