How to reset a wordpress 2.5 password when you can’t get emails
If you are using a good non trivial password for your wordpress blog, then it is very likely that at some point in time you will forget it. This is not a real issue as long as you can go to your login page and request that a new password will be generated and sent to your e-mail account, but sometimes you either don’t have access to your mail, or the server is not configured to send mails. If you are in this unfortunate situation you need a method to bypass the normal wordpress password administration procedures.
For pre-2.5 wordpress versions, all you needed is an access to your server’s phpmyadmin, and you could follow the simple instructions at devlounge to reset your password. Since the 2.5 the method in which passwords are being hashed when stored at the database had changed, and the hashing is no longer a simple MD5. More then that, the hashing function is now pluggable (can be overridden by a plugin) which means that there is no more a uniform way to calculate the hash results as was described at the devlounge article.
The following script pass-calc solves this problem by calculating a password hash using the relevant functions from your wordpress installation. All you have to do is download the script, install it at your wordpress root directory, and run it by navigating to {your wordpress url}/calc-pass.php.
The script will ask you to enter the new password, and will generate an hash code for it. This hash code should be stored at your database by following the same instructions described in the devlounge article.
The script intentionally does only the calculation and do not update the database as this can be a security breach.