How to unlock Xiaomi phone if you forget your password without losing data

A forgotten password on a Xiaomi smartphone is a situation that one in five users encounter, according to service center statistics. The main problem: standard unlock methods (for example, through Mi Account) often lead to a complete data reset, which means losing photos, messages and installed applications. However, there are ways to get around the lock without formatting memory – if you act quickly and correctly.

In this article, we will discuss 5 working methods of unlocking Xiaomi (including the Redmi Note 12, POCO X5, Mi 11 and others) on current versions of MIUI 14/15. Importantly, the effectiveness of the method depends on whether the Mi Account was previously linked, whether debugging is enabled over USB and whether there is a backup in the cloud. If any of these conditions are met, the chances of saving data increase by up to 90%.

Before you start, check:

  • πŸ”‹ Battery level (must be at least 30% - when discharged during the procedure, the phone can lock permanently).
  • πŸ“Ά Availability of stable Internet (you will need to log in to Mi Account or download tools).
  • πŸ–₯️ Access to a computer (for methods using the ADB Or Mi Flash Tool).
πŸ“Š What kind of Xiaomi model do you have?
Redmi (Note/Pro series)
POCO (F/X/M)
Mi (flagship series)
Black Shark
Another model

1 Unlocking through Mi Account (if the phone is linked to the account)

The most reliable way is to use the official password reset function through your Xiaomi account, which works if:

  • πŸ“± The phone was tied to Mi Account before being locked.
  • 🌐 The device has access to the Internet (Wi-Fi or mobile network).
  • πŸ”‘ You remember your account login and password (or you can restore them through your account). email/SMS).

Instructions:

  1. On the lock screen, tap Forgot password? (or Forgot password? on English firmware).
  2. Choose Restore through Mi Account.
  3. Enter the email or phone number associated with the account and confirm the code from the SMS/letter.
  4. Create a new unlock password.

The advantage of the method is that it doesn't require a computer and it saves all the data, and the disadvantage is that if the account is not tied or the password is forgotten, it won't work.

πŸ’‘

If you don’t remember the password from Mi Account, try to restore it through account.xiaomi.com. Use the backup email or phone number provided when you register.

2.Using Fastboot and Mi Flash Tool (for advanced users)

If Mi Account is not tied and USB debugging (ADB) has been enabled before locking, you can try unlocking your phone via Fastboot.This method is suitable for models on Qualcomm Snapdragon (e.g. POCO F5, Redmi K60) and requires:

  • πŸ’» Computers with installed Xiaomi drivers and Mi Flash Tool.
  • πŸ”Œ Cable. USB (preferably original).
  • πŸ“„ The firmware file is the same version that is installed on the phone (you can download it on the official website).

Step-by-step:

  1. Turn off the phone. Press the Power button + Volume down to enter the Fastboot.
  2. Connect the device to a PC. In the Mi Flash Tool, select the downloaded firmware file (.tgz format).
  3. In the program settings, mark Clean all and lock (this is important, otherwise the data will disappear!).
  4. Press Flash and wait until it is completed (the process will take 5-10 minutes).
What if the Mi Flash Tool can't see the phone?
Make sure the drivers are installed correctly (use Mi Phone Manager for automatic installation). If the device is identified as Qualcomm HS-USB QDLoader 9008, then the phone is in EDL mode - you will need an authorized Xiaomi account to exit it.

Note: this method does not work on all models. On phones with a Mediatek processor (such as Redmi 10C), unlocking through Fastboot can lead to data loss.

3. Unlock via ADB (if USB debugging is enabled)

If you activated USB debugging before blocking (Settings β†’ About Phone β†’ MIUI β†’ 7 taps by build number β†’ For developers β†’ Debugging by USB), you can delete the password file via ADB. This method saves all data, but requires:

  • πŸ–₯️ Computer with Android installed SDK Platform-Tools.
  • πŸ”Œ Connecting the phone to the PC in mode USB-Debugging (even if the screen is locked!).

Instructions:

adb shell


su




rm /data/system/gesture.key




rm /data/system/password.key




rm /data/system/locksettings.db




rm /data/system/locksettings.db-wal




rm /data/system/locksettings.db-shm




reboot

After the reboot, the phone unlocks, but you may need to reconfigure the pattern lock or PIN.

πŸ’‘

The ADB method only works if the debugging was enabled before locking, and if you've never connected your phone to a PC in developer mode, it won't work.

⚠️ Attention: on some firmware MIUI 15 password files are stored in an encrypted partition, in which case the rm command will not help - an alternative approach will be required (see section on the subject). TWRP).

4. Installation of custom TWRP Recovery (for unlocked bootloader)

If your Xiaomi bootloader is unlocked, you can install custom TWRP recaps and manually delete password files. This method is suitable for enthusiasts, as it requires:

  • πŸ”“ Unlocked bootloader (checked by the command fastboot oem device-info – if Device unlocked: true, you can continue to use the device).
  • πŸ“± Compatible version TWRP For your model (download on twrp.me).
  • πŸ’Ύ Backup of data (in case of error).

Algorithm of action:

  1. Install TWRP via Fastboot: fastboot flash recovery twrp.img fastboot boot twrp.img
  2. Go to Advanced β†’ File Manager.
  3. Delete files: /data/system/gesture.key, /data/system/password.key, /data/system/locksettings.db*.
  4. Reboot the phone.

Warning: Installing TWRP incorrectly can lead to a phone "brick" (completely inoperable) if you are not sure about your actions, contact the service center.

5. Contact Xiaomi Service Center (official method)

If none of the above methods worked, the last option is to officially contact the Xiaomi service center.

  • πŸ”§ Unlocking without risk of damaging your phone.
  • πŸ“„ Preservation of the guarantee (if it is still valid).
  • πŸ›‘οΈ Minimum risk of data loss (in 60% of cases, specialists save files).

What will be required:

  • πŸ“„ Check or warranty card (to confirm possession).
  • πŸ†” Passport (for identification of the person).
  • πŸ’° Payment for the service (the cost of unlocking in 2026 - from 1,500 to 3,000 rubles, depending on the model).

⚠️ Warning: informal services often offer "unlock in 5 minutes" with a complete data reset. Avoid such workshops - they use illegitimate methods that can damage the firmware.

Bring the original box and documents to your phone|Make sure the battery level is >50%|Remove the cover and protective film (to inspect the device)|Prepare a backup of important data (if you have access to the cloud)-->

Comparison of Xiaomi Unlocking Methods without Data Loss

MethodConditions requiredData retentionDifficultyTime.
Mi AccountLinked account, Internetβœ… 100%⭐5-10 minutes
ADBIncluded debugging on USB, PCβœ… 100%⭐⭐⭐15-20 minutes
Fastboot + Mi FlashThe same version of the firmware, PC⚠️ 70% (depending on the model)⭐⭐⭐⭐30-40 minutes
TWRPUnlocked bootloader, PCβœ… 95%⭐⭐⭐⭐⭐40+ mine
Service centrePhone ID, payroll⚠️ 60%⭐1-3 days

Frequent Mistakes and How to Avoid Them

When trying to unlock Xiaomi, users often face typical problems:

  • πŸ”„ "Phone is not defined in Fastboot" - check the cable (use the original), install drivers via Mi Phone Manager.
  • πŸ” "ADB Do not see the device – make sure that the debugging USB It was turned on before the lockdown. If it wasn't, it wouldn't work.
  • πŸ“± "After flashing, the phone doesn't turn on, you probably picked the wrong firmware version. EDL, This requires an authorized Xiaomi account.
  • πŸ”’ "Mi Account is blocked" - if you have entered the password incorrectly several times, the account may be temporarily blocked. Wait 24 hours or restore access through a backup email.

Tip: If the phone gives an error "This device is locked" when trying to flash TWRP, then the bootloader is locked. You can only unlock it officially through the Xiaomi website (the process takes up to 720 hours of waiting!).

Can I unlock Xiaomi without a computer?
Yes, if your phone is tied to Mi Account, use the "Forgot Password?" option on the lock screen, if your account is not tied, you can't do without a PC (you need ADB or Fastboot).
What to do if you forget your Mi Account password?
Restore access through the recovery page. If a backup email or phone number is tied, you will receive a password reset code. If not, contact Xiaomi with proof of ownership of the device (check, IMEI).
Does the ADB work on MIUI 15?
On most devices, yes, but on some firmware (such as Xiaomi 13T with MIUI 15.0.4), password files are stored in an encrypted partition, in which case ADB will not help, you will have to use TWRP or contact the service.
Can I unlock my phone if it’s turned off and not turned on?
If the phone does not respond to the charge or power button, you first need to restore its performance (for example, through the use of a power button). EDL-UFi or EasyJTAG boxing is a complicated procedure that is best left to the professionals.
Will the data be erased if you unlock your phone through a service center?
It depends on the method the wizard uses. Xiaomi's official centers try to save data, but there's no guarantee. Always check in advance whether a full reset or attempt to bypass the lock will be performed.