Password retrieval failed!

August 2nd, 2007

Tonight I forgot my admin password. Thought: no problem! Hit the “Lost Password?” link at the WordPress login screen.

Now, that might happen once in a lifetime: PHP was not able to talk to the local mailserver! Therefore no password was sent!

The first thing to do was a quick ckeck:

 function helpme() {
  if(mail("please@help.me","test","test")) {
   echo "success";
  } else {
   echo "error";
  }
 }
helpme();

helpme() returned “success” but nothing happened. No email at my inbox.

After checking DNS-MX records and looking at phpinfo() it was crystal clear that there must be a server misconfiguration. Since I do not have root access to this machine, I wrote a small script, to help me out. It is a simple admin-password resetter containimg a form for setting a new admin password. The POST-value is overwrites the unretrievable on in the WordPress database:

	$sql = "UPDATE ".$wpdb->users."
                  SET user_pass = '".md5($_POST['emergency_pass'])."'
                  WHERE user_login = 'admin'";
	$link = $wpdb->query($sql);
	wp_redirect('wp-login.php');
	exit();

Download: WordPress Admin Password Resetter

Usage:

  1. Unzip
  2. Upload password-resetter.php to your WordPress root (!this is NOT a WordPress Plugin!)
  3. run http://[your WordPress URI]/password-resetter.php
  4. set a new password
  5. Very important: DELETE password-resetter.php
Share This
  1. AskApache Says:

    Very very cool download! I created a wordpress plugin that you might want to check out…

    htaccess password protect wp-admin

  2. Pingback: XirBIT Blog » ??????????? Admin ??????????????? ? September 13th, 2007 at 6:44 am
  3. Pingback: XirBIT Blog » ??????????? Admin ??????????????? ? September 14th, 2007 at 8:46 am
  4. Pingback: Code Snippet Highlighting Wordpress ?çin Kod Uygulamas? | Rasim Co?kun | Web Tasar?m | Web Design October 16th, 2007 at 1:15 pm
  5. Pingback: Code Snippet Highlighting Wordpress ?çin Kod Uygulamas? | Rasim Co?kun | Web Tasar?m | Web Design October 16th, 2007 at 2:16 pm
  6. Pingback: XirBIT Blog » Blog Archive » ????????????? Admin ???? October 30th, 2007 at 10:15 am
  7. Pingback: Password retrieval failed! » ==???????==|GRE????|TOEFL????|SAT,IELTS,GMAT,visa,USA,??,??,??,??,??,???,?? January 9th, 2008 at 4:08 am
  8. Cardin Says:

    I’m really rusty with MySQL and PHP, but can’t you just have logged into PHPMyAdmin and look for your username password values??

  9. Pingback: ????@sh18 » Blog Archive » ?????Bloggingpro china February 28th, 2008 at 11:20 am

Leave a Reply

For support questions, bug reports and troubleshooting regarding plugins from this site, please visit the forum.

See also:

Plugins in action: Mini-Slides

Turakraft uses Mini-Slides.

Plugins in action: Mini-Slides on timbuktoons.tv

Timbuktoons uses the Mini-Slides plugin.

This time it's Facebook

As being advised I did my Facebook page today ;)

Plugins in action: Find Us

KGALEWOOD, the Botswana Travel Community Podcast Channel uses Find Us.

Close
E-mail It