put the following code in drupal root directory and then change the $pwd value to your desired password and the visit this file in browser and you will a hash password and update it direclty in databse
UPDATE users SET pass = '[hash]' WHERE uid = 1;
in my case uid was 1 .
$pwd = 'password';
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
header("Content-Type: text/plain; charset=utf-8");
source : http://drupal.org/node/865818