how to change drupal admin password

In case you forgot your drupal admin password and you want to change or reset it, go to index.php file and after this line

<?php
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

this piece of code:

<?php
$pass = md5('yourNewPassword');
$query = "UPDATE {users} SET pass='%s' WHERE uid=1 LIMIT 1";
db_query($query, $pass);
echo 'Change drupal password: done';
exit();

After you get the message "Change drupal password: done" you can undo the changes made to index.php