October 25, 2012

Locked myself out of Wordpress

Another booboo I made while moving my Wordpress blog to another server was entirely my own fault, I forgot the administrator password I had setup, myep. Here's a way to manually correct this without using something like phpMyAdmin. I'm assuming you have root access to your web server.

Login to MySQL

mysql -u root -p
SHOW databases;
USE wordpressdb;
SELECT * FROM wp_users;

To get the md5 hash for your password you have a few options, visit this md5 Hash Generator or let MySQL do it for you...

UPDATE wp_users SET user_pass='442123aac165e12d65943f3a4114bbf3' WHERE user_login='administrator';
UPDATE wp_users SET user_pass = MD5('"(new-password)"') WHERE user_login='administrator';

You should now be able to login to Wordpress again. Here is a useful article from Wordpress.org covering more ways to reset your admin password.

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket
Comments powered by Disqus