I did it a few times but always made a search and dug WordPress code. So, just generate a new password:
PHP -r 'echo crypt("new_wp_pass") . "\n";'
and update specified user in the table wp_users:
UPDATE wp_users SET user_pass='generated password hash' where ID='desire user ID';
When you manage some serious system where users can change their passwords you’ll face with problem of quality of those passwords. There is a Perl module – Data::Password, which may do all work to check user passwords: length or the number of character groups. Also, it’s possible to make more complicated checking: the password does not contain the same chars repeatedly or ascending or descending characters, or charcters close to each other in the keyboard. You can use system dictionary files (/usr/share/dict/words for Fedora Core 5, for example) or create you own. The module has only two methods and six variable which can be imported into your script/module to customize checking. Here is a small example of using Data::Password:
use Data::Password qw(:all);
$DICTIONARY = 0;
$GROUPS = 0;
# Will print "Bad password - contains the word 'clear', only lowercase"