after installing magento in my local machine I forgot admin password

after installing magento in my local machine I forgot admin password

July 3, 2026 · Illustrated author avatarBy Stefan Bogdanescu
after installing magento in my local machine I forgot admin password

Forgotten Magento Admin Password? Here’s How to Reset It

So you’ve installed Magento on your local machine—and promptly forgotten the admin password. Don’t panic! Resetting this password is actually quite straightforward once you understand the process.

Understanding Magento’s Admin Password Reset Process

Magento stores its admin passwords in a hashed format, which means simply editing the database won’t work (unlike some other platforms). To reset an admin password, you need to follow these steps:

  1. Connect to your MySQL database using phpMyAdmin or your preferred client.

  2. Locate and open the core_config_data table.

  3. Find the row where path = 'admin/startup/username' and note down the value—the admin username you used during installation (this is usually “admin”).

Resetting Your Magento Admin Password

Now that you have your admin username, let’s reset the password:

Open a terminal or command prompt on your local machine. Navigate to your Magento root directory and run this command to reset the password for “admin” user (replace your-password with whatever you want):

php bin/magento admin:user:create --all --username="admin" --password="your-password"

This will create a new admin account with the specified username and password. Log in using this account to access your Magento admin.

Method 2: Manual Database Update (For Advanced Users)

If you prefer a manual database approach:

  1. Connect to your MySQL database again.

  2. Locate the admin_user table.

  3. Find the row with username = 'admin' and update the following columns:

    • Set password_hash to the desired hashed password value (you can generate this using various online tools, or manually hash it if you prefer).

    • Set confirmation_key to a random string of your choice.

    • Set password_reset_key to a new random string.

  4. Save and exit.

  5. Log in using the updated credentials.

Troubleshooting Common Issues

If you’re having trouble resetting your password, here are some things to check:

  • Ensure you’ve connected to the correct database.

  • Double-check that you’ve replaced your-password with a valid string.

  • If you still can’t log in, try flushing Magento’s cache:

    php bin/magento cache:flush
    

Conclusion

Resetting your Magento admin password isn’t as daunting as it might seem at first. By following the outlined steps—whether using the command line or manual database update—you can regain access to your local Magento installation in no time.

Remember, always backup your database before making any changes to ensure you don’t lose critical data.

If you’re looking for more Magento tips and tutorials, check out our blog at Laravel Company. We cover a wide range of Magento topics, from development best practices to advanced customization techniques. Happy resetting!

Database Admin Configuration Customers

Our network