What is Magento?
Magento is an online shop platform. You manage your products and orders from its admin panel. If you lose the password, you can reset it by email, from the command line, or in the database.
Method 1: Use the email link
- Go to your admin address. It is often
yourdomain.com/admin, but it can be custom. - Click Forgot your password?
- Type your admin email and click Retrieve Password.
- Open the email and click the link.
- Type a new password twice and save.
If no email comes, check spam. Your store must be able to send email.
Method 2: Use the command line
The command line is a text window where you type commands. You need SSH access. SSH is a safe way to connect to your server. Ask Hostvento support if your plan has it. This is for Magento 2.
- Connect to your server by SSH.
- Go to your Magento folder with
cd. - Run this command, with your own username and password:
php bin/magento admin:user:create --admin-user="newadmin" --admin-password="Choose-A-Strong-Pass-1" --admin-email="you@example.com" --admin-firstname="Your" --admin-lastname="Name"
This creates a new admin user. Log in with it and then change the old user's password inside the panel.
Method 3: Edit the database
Warning: You are changing the database. Take a backup first.
- Log in to cPanel and open phpMyAdmin.
- Click your Magento database.
- Open the table
admin_user. - Click Edit on your admin row.
- In the
passwordfield, paste a new hashed password. A hash is a scrambled form. Magento 2 uses a salted hash, which is hard to build by hand, so the command in Method 2 is better.
On Magento 1 the old trick was to use an MD5 value with a salt. Magento 1 is very old and no longer supported. Move to Magento 2 if you can.
After you log in
- Click your name, then Account Setting.
- Set a new strong password.
Quick recap
- Try the Forgot your password? link first.
- Use
bin/magento admin:user:createif you have SSH. - Edit the database only as a last choice, and back up first.
- Change to a strong password after login.