There are several methods to recover the Drupal administrator ("user 1") password. The fastest way is using drush for Drupal 7. For Drupal 8, DrupalConsole provide a suite of commands to recovery and manage users passwords.
Recover password with DrupalConsole (Only Drupal 8).
DrupalConsole offers several ways of recovering the administrator's password.
DrupalConsole can generate a one-time login link.