How to unlock Xiaomi Redmi 5A through your computer: 3 proven ways

Forgot the pattern lock or PIN-code 5A? Do not rush to carry it to the service center - in 80% of cases, you can unlock yourself through a computer. This guide will work even if you don’t have access to your Mi Account, and your phone asks for confirmation after resetting your settings.

We'll look at three working methods: official Mi Unlock Tool (to unlock the bootloader), Fastboot reset, and alternative ADB. Each option has its own nuances, from waiting 72 hours to the risk of data loss. Importantly, if the phone has Find Device enabled, some methods may not work without first disabling this option.

Before you start, check:

  • πŸ”‹ Redmi battery level 5A β€” If you discharge during the procedure, the phone can turn into a brick".
  • πŸ’» The computer has Qualcomm drivers installed and ADB/Fastboot (References to downloads - in the relevant sections).
  • πŸ“₯ The original is at hand. USB-cable (do not use cheap Chinese analogues - they often cause connection errors).
πŸ“Š Why You Needed to Unlock Redmi 5A?
Forgot your password/pattern lock
I bought a used phone with a lock.
I want to run a custom firmware.
Other

Preparation of the computer: drivers and programs

Without properly installed drivers, your computer simply won’t see your Redmi 5A in Fastboot or EDL modes. Let’s start with the most important thing – installing the Mi USB Driver and the ADB/Fastboot package.

For Windows 10/11, download the official driver from Xiaomi:

  • 🌐 Download page Mi Unlock Tool (at the bottom of the page there is a link to drivers).
  • πŸ“ Unpack the archive and run DriverInstall.exe on behalf of the administrator.
  • πŸ”„ After installation, restart your computer – it is a must!

Next, install Minimal ADB and Fastboot (lightweight version, no unnecessary components):

  1. Download the tool with XDA Developers.
  2. Start the installer and follow the instructions (the installation path is best left by default: C:\Program Files (x86)\Minimal ADB and Fastboot).
  3. After installation, open the Command Prompt in the utility folder (click Shift + right mouse button β†’ β€œOpen PowerShell window here”).

⚠️ Note: If you have an Avast or Kaspersky antivirus, temporarily disable it while you install drivers.These programs often block Xiaomi files, considering them suspicious.

Check the phone's connection:

  1. Turn off Redmi 5A.
  2. Press Volume Down + Power before the Fastboot logo appears.
  3. Connect your phone to your PC and type in the command line: fastboot devices If in response you saw the serial number of the device - the drivers are installed correctly.

2. Official method: Mi Unlock Tool (to unlock the bootloader)

This method is suitable if you want to unlock the bootloader for later firmware or if the phone is locked due to binding to the Mi Account. Note: Xiaomi has introduced a restriction - after linking the account to the device, you need to wait 72 hours before unlocking.

Step-by-step:

  1. Download Mi Unlock Tool from the official website (version must be at least 5.5.224.24).
  2. Unpack the archive and launch it. miflash_unlock.exe on behalf of the administrator.
  3. Sign in to your Mi Account (if you forgot your password, restore it in advance!).
  4. Connect your phone in Fastboot mode (as in the previous section).
  5. Press Unlock and confirm the action.

If you see a "Couldn't unlock" or "Current account is different from the one bound to this device" error, you will see:

  • πŸ”„ You didn’t wait 72 hours after you linked your account.
  • πŸ“± The phone was bought with hands and tied to someone else’s account (the solution is to contact the previous owner or use alternative methods).
  • 🌍 You are trying to unlock your phone from a region other than where it was activated (e.g., a phone for China will be unlocked in Russia).

⚠️ Note: Once the bootloader is unlocked, all data, including photos and apps, will be deleted from the phone. If you want to save information, try the method first with the help of the bootloader. ADB (section).

Battery level of charge > 50%|Drivers are installed and the phone is determined in Fastboot|Mi Account tied to phone more than 72 hours ago|Disabled antivirus that blocks the work of the utility|Used by the original USB-cable-->

3.Reset via Fastboot: Completely clean the phone

If you don't have to save data, and the main goal is to just remove the lock, this is the fastest method. It works even if you don't remember the data from the Mi Account, but the phone should support Fastboot mode.

Instructions:

  1. Connect Redmi 5A to your computer in Fastboot mode (clip Volume Down + Power).
  2. Open the command line in the folder with ADB and enter alternately: fastboot flashing unlock fastboot flashing unlock_critical fastboot erase userdata fastboot erase frp fastboot reboot
  3. After the reboot, the phone will be like after the purchase - without a password and binding to the account.

If the fastboot flashing unlock command doesn’t work, try an alternative:

fastboot oem unlock


fastboot erase userdata




fastboot erase frp




fastboot reboot

Possible errors and solutions:

Mistake.Reason.Decision
FAILED (remote: unknown command)An outdated version of FastbootUpdate ADB to the latest version or use MiFlash
device not foundDrivers are not installed or the cable is faultyCheck the connection, try another USB port
This device is lockedbootloader lockedUse the Mi Unlock Tool (Section 2)
erase not allowedAnti-Rollback protection includedSwipe your phone through EDL (Section 5)

πŸ’‘

If after resetting the phone, again asks to enter the old password, then the lock was tied to the Google account (FRP), in this case, after the command fastboot erase frp, you need to additionally perform fastboot erase config and reboot.

4.Alternative method: Unlocking through ADB (without data loss)

This is the only way to save data on your phone if you forget the pattern lock, but remember the Mi Account password or you have USB debugging enabled. The method only works if the phone has previously activated the USB debugging option in the developer settings.

How to check if the debugging is included:

  • πŸ”§ Go to Settings. β†’ The phone. β†’ Version. MIUI and tap 7 times on this item to activate the developer mode.
  • πŸ” Back to Settings β†’ Additionally. β†’ For developers and find the Debugging item USB.
  • πŸ”„ If the option is active, you can start unlocking.

Instructions for unlocking:

  1. Connect your phone to your computer (on!).
  2. Open the command line and type in: adb shell su rm /data/system/gesture.key rm /data/system/locksettings.db rm /data/system/locksettings.db-wal rm /data/system/locksettings.db-shm reboot
  3. After the reboot, the screen lock will be reset.

If the su command doesn’t work (no root rights), try to do without it:

adb shell


cd /data/data/com.android.providers.settings/databases




sqlite3 settings.db




update system set value=0 where name='lock_pattern_autolock';




update system set value=0 where name='lockscreen.lockedoutpermanently';




.quit




reboot

⚠️ Note: Some of the Redmi firmware 5A (for example, MIUI 12 and later) this method may not work due to the increased protection, in which case only a Fastboot reset or EDL.

What if the ADB can’t see the device?
1. Check if the debugging is included USB (A notification of connection to the computer should appear). 2. Try another one. USB-cable (preferably original). 3. Install drivers manually through Device Manager (select "Update driver" β†’ "Perform a search on this computer" β†’ specify the driver folder ADB). 4. Disable driver signatures in Windows (temporarily): Open the command line on behalf of the administrator and type bcdedit /set nointegritychecks on, then restart the PC.

5.Extreme method: Firmware through EDL (for experienced)

If all previous methods failed, the EDL (Emergency Download Mode) mode remains, which requires a special cable or short circuit of the contacts on the board, so it is only suitable for advanced users. Wrong actions can permanently bring the phone down!

What you need:

  • πŸ“₯ Firmware for Redmi 5A (Download the Xiaomi Firmware Updater).
  • πŸ”§ MiFlash program (official firmware utility).
  • πŸ”Œ EDL-cable or ability to close test points on board.

Step-by-step:

  1. Install MiFlash and unpack the firmware into a folder without Cyrillic characters.
  2. Turn off the phone and put it in mode. EDL: Method 1: Use it. EDL-cable (connect it to the phone and USB-Port of Port. 2: Take the phone apart, find the points on the board EDL (usually signed and close them with tweezers on 2-3 seconds.

MiFlash

Select

Connect the phone – if the drivers are installed correctly, the program will determine it.

Clean all

Flash

It takes 5-10 minutes. Once it's done, it'll restart in a factory state. If the firmware is successful, but the phone doesn't turn on, try:

  • πŸ”„ Repeat the firmware with the choice of Clean all and lock mode.
  • πŸ“₯ Download a different firmware version (e.g. Global Stable instead of China Stable).
  • πŸ”§ Check the battery contacts – sometimes they leave after disassembly.

πŸ’‘

Firmware through EDL is the most reliable way to unlock, but also the riskiest. If you don't have experience with a soldering iron or test points, you'd better go to a service center.

6. Frequent errors and their solutions

Even if you follow the instructions accurately, you can get errors, and we've collected some of the most common problems and ways to fix them.

Error 1: "This device is locked" in Fastboot

  • πŸ”“ Solution: Unlock the bootloader through the Mi Unlock Tool (Section 2).
  • ⏳ If you don’t have time to wait 72 hours, try flashing your phone through the phone. EDL (section).

Error 2: Phone is not defined in Fastboot or ADB

  • πŸ”Œ Check the cable and port USB (Better to use back ports on PC).
  • πŸ–₯️ Reinstall drivers manually through Device Manager.
  • πŸ”„ Try another computer (sometimes drivers conflict).

Error 3: After resetting, the phone asks for an old one PIN-code

  • πŸ” That means the defense worked. FRP (Factory Reset Protection).
  • πŸ“± Enter the data from the last Google account that was on your phone.
  • 🚫 If you don’t remember the data, run the phone through the EDL Completely erased (Clean all).

Error 4: "Anti-Rollback check fail"

  • πŸ”™ This means you are trying to re-shoot an older version. MIUI, more than the one that was established.
  • πŸ“₯ Download the firmware of the same or newer version.
  • πŸ”§ If you need the old version, disable the Anti-Rollback check through the modified Fastboot (requires root rights).

7.How to avoid blocking in the future

To avoid having to deal with the problem of a locked phone again, follow these tips:

  • πŸ” Use fingerprint or facial recognition as your primary method of unlocking them – they’re more reliable. PIN-code.
  • πŸ“ Write backup unlock codes (for example, in a notebook or password manager).
  • πŸ”— Link your phone to your Mi Account and enable data synchronization.
  • πŸ”„ Make backups regularly through Settings β†’ System system β†’ Backup.
  • 🚫 Do not buy phones from your hands without first resetting and decoupling from the account of the previous owner.

If you often forget passwords, set up Smart Lock in Android:

  1. Go to Settings β†’ Lock and Protection β†’ Smart Lock.
  2. Add reliable devices (such as home Wi-Fi) or places where your phone will unlock automatically.
  3. Activate the voice unlock option (if available on your firmware).

πŸ’‘

MIUI has a hidden emergency unlock function: if you enter the wrong password 5 times in a row, the button "Forgot your password?" β†’ "Emergency call" β†’ dial # # # # #7378423##. This will only work if the phone does not have an attachment to Mi Account.

FAQ: Answers to Frequent Questions

Can I unlock Redmi 5A without a computer?
Yes, but only if you have a Mi Account tied and your mobile Internet/Wi-Fi enabled. Try: On the lock screen, click "Forgot your password?" Enter the data from your linked Xiaomi account. Follow the instructions to reset your password. If this doesn't work, the computer is the only option.
What if the phone doesn’t turn on after unlocking?
Possible causes and solutions: πŸ”‹ Battery is dead – plug it into charging for 30 minutes, then try turning it on. πŸ”Œ Wrong firmware – run the phone again through EDL correct-cut MIUI. πŸ”§ Damaged fee – if the phone does not respond to charging and is not determined by the computer, contact the service.
How do I know if the Redmi 5A bootloader is unlocked?
Turn off your phone and turn it on in Fastboot mode (Put Volume Down + Power). If you have "Unlocked" on the bottom of the screen, the bootloader is unlocked. If "Locked" is locked.
Can I unlock my phone if the previous owner hasn’t untied his Mi Account?
Technically, yes, but it would require: Swipe your phone through an EDL with complete data erasure, or contact Xiaomi's service center with proof of purchase (check, purchase agreement), you can't untie someone else's account without access to it.
Which firmware is best for Redmi 5A after unlocking?
Recommended options: 🌍 Global Stable is the most stable version for the international market. πŸ‡¨πŸ‡³ China Stable – if you want maximum functionality, but without Google services. πŸ”§ Xiaomi.eu is custom firmware with optimizations and no advertising (requires an unlocked bootloader). download firmware only from official sources: en.miui.com or Xiaomi Firmware Updater.