One of the most common categories of Magento issues that you will encounter while working with Magento websites is that of Magento Admin Panel login issues. Let take a closer look at these kinds of Magento issues and how to resolve them.
This article will explore and explain several Magento Admin Panel login issues, common situations where you may experience these kinds of access issues, and how to fix them.
How to access the Magento Admin Panel
If you want to access the Magento Admin Panel, follow the steps below:
1. Enter the URL that was specified during the Magento installation, followed by the base URL of your Magento store’s Admin Path in your browser.
2. The default Magento Admin URL will look like https://www.yourdomain.com/admin.
3. If you are using a custom Magento Admin URL, your Magento Admin URL will look like https://www.yourdomain.com/<Admin Path>.
4. You can find the Admin Path from <Magento_root_directory>/app/etc/env.php file under the backend section:
Default Admin Path
'backend' => [
'frontName' => 'admin'
],
Custom Admin Path
'backend' => [
'frontName' => 'mag_backend'
],
5. Enter the username and password for your Magento Admin Account:
6. Click on the Sign In button.
7. The Magento Admin Panel will appear and looks like this screenshot:
8. Suppose you are facing a Magento Admin Panel login issue. In that case, you may receive different error messages while logging into the Magento Admin Panel, depending on the Magento version that you are using.
8a. If you are using Magento versions 2.0 through 2.2.9, you will receive the following error message while accessing the Magento Admin Panel:
8b. Suppose you are using Magento versions 2.3.x and above, you will receive the following error message while accessing the Magento Admin Panel:
Common Magento Admin Panel login issues regarding access
The list of the everyday situations in which you may encounter a Magento Admin Panel login issue is as follows:
- Trying to access the Magento Admin Panel after the Magento installation via the command line.
- Trying to access the Magento Admin Panel with the wrong username and password multiple times.
- Trying to use a Magento Admin Account that does not meet its password complexity requirements.
Troubleshooting and resolving common access issues for the Magento Admin Panel
You can Troubleshoot and resolve common access issues for the Magento Admin Panel by exploring the four solutions documented in the next sections.
1. Unlock the Magneto Admin Account
Magento occasionally locks an account for security reasons. You can run the following command from your website's Magento root directory to unlock the account:
php bin/magento admin:user:unlock <username>
For example, if you want to unlock the account mag_admin, you can run the following command:
php bin/magento admin:user:unlock mag_admin
Here is the output:
]$php bin/magento admin:user:unlock mag_admin
The user account "mag_admin" has been unlocked
If the account is not locked or the account can’t be unlocked, you will get the following message while running the command:
]$php bin/magento admin:user:unlock mag_admin
The user account "mag_admin" was not locked or could not be unlocked
If the account does not exist, you will receive the following message running the command:
]$php bin/magento admin:user:unlock mag2_admin
Couldn't find the user account "mag2_admin"
2. Check the locked user in the database
If you want to check the locked user in the database via the phpMyAdmin tool, follow the steps below:
1. Log in to phpMyAdmin.
2. Click on your database by name.
3. Then, click on the admin_user table:
4. Find the locker user account and ensure that the database column with the name is_active has a value is set to 1 (one):
5. If the value is not set to 1 (one), you can click on the Edit link and change the value to 1 (one). Then, click the Go button to save the changes:
6. The admin_user_session table can also be truncated in an effort to resolve the problem.
3. Change the Magento Admin Account password using a MySQL command
If you want to change the Magento Admin Account password using the MySQL command, run this command from the MySQL prompt:
SET @salt = MD5(UNIX_TIMESTAMP());
UPDATE admin_user SET `password` = CONCAT(SHA2(CONCAT(@salt, 'new_password'), 256), ':', @salt, ':1') WHERE username = 'admin_username';
You can replace admin_username and new_password with your Magento Admin Account username and password.
Here is the sample output:
MariaDB [testdb_ad]> SET @salt = MD5(UNIX_TIMESTAMP());
Query OK, 0 rows affected (0.001 sec)
MariaDB [testdb_ad]> UPDATE admin_user SET `password` = CONCAT(SHA2(CONCAT(@salt, 'wYcHyynQDhvrU'), 256), ':', @salt, ':1') WHERE username = 'mag_admin';
Query OK, 1 row affected (0.002 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [testdb_ad]>
4. Create a new Magento Admin Account
If any of the above solutions are not working, you will need to create a new Magento Admin Account for your website. You will need to run the following commands from your Magento root directory:
php bin/magento admin:user:create --admin-user="new_username" --admin-password="new_password" --admin-email="new_email_address" --admin-firstname="firstname" --admin-lastname="lastname"
Replace the new_username, new_password, new_email_address, firstname, and lastname values as per your requirements.
Here is the sample output:
$ php bin/magento admin:user:create --admin-user="magento_user" --admin-password="W85VJ9Fp0CIZQ" --admin-email="testuser@example.com" --admin-firstname="firstname" --admin-lastname="lastname"
Created Magento administrator user named magento_user
This issue is also caused by Magento 2's security mechanism. If any accounts do not meet Magento 2’s password complexity requirements, Magento 2 will temporarily disable those accounts.
By default, the password that meets Magento 2's security requirements must consist of the following:
- Uppercase letters
- Lowercase letters
- Numeric
- Special characters
- Minimum of eight characters
So, you must follow Magento 2's security requirements when setting up the password for your Magento user accounts.
Conclusion on fixing your access issues for the Magento Admin Panel
You can quickly fix the Magento Admin Panel login issues by following the access troubleshooting steps mentioned in the article. Often, the resolutions to each kind of problem addressed above are straightforward.
Decades of Nexcess expertise
Magento was built on Nexcess servers. If you're looking for a professional ecommerce platform, we have both the knowledge and expertise to help you succeed. We know Magento better than any other host.
However, if you still need help accessing your Magento Admin Panel or require advice with the Magento hosting plan, feel free to contact our Magento specialists.
Recent articles
- Securing your site with the Magento Security Scan
- Truncating MariaDB/MySQL tables in the Nexcess Cloud
- Importing and exporting a MySQL database