Hacking into Wordpress admin account

I setup Wordpress on a domain last week. For those that are familiar, when you first install Wordpress, it gives you a temporary password. Well, I logged in using that temporary password, made some configuration changes, and then logged out (without remember to set a new password!). Of course, I’d forgotten the temporary password… D’oh!

Usually, you can use Wordpress’s “Forgot Password” function, which will send an email to the address you defined for admin during setup. But in this case, this option wasn’t available to me - I might have mistyped the email address when I entered it :(

So I had to research how to hack in and reset the admin password. This is what needs to be done:

This process worked for my Wordpress 2.1.3 setup. Use at own risk!

  • Log into phpMyAdmin (the MySQL admin)
  • Select the database, and click on the SQL tab
  • Enter this:

    SELECT ID, user_login, user_pass FROM wp_users WHERE user_login = ‘admin’;

    where wp_users is the table (wp_users is the default name for Wordpress 2.1.3, but your version might be different, so check!

  • It should show you the table record for the admin account. If it doesn’t, stop here and figure out why that SQL command doesn’t work.
  • Enter this:

    UPDATE wp_users SET user_pass=MD5(’password‘) WHERE user_login =’admin’;

    where wp_users is the table (wp_users is the default name for Wordpress 2.1.3, but your version might be different, so check!
    where password is the new password you want to use

  • If phpMyAdmin returns a successful response, login using the new password!
Comments
There are no comments just yet, why not be the first?
Leave a Comment
Add your picture!
Join MyBlogLog and upload your avatar. C'mon, it's free!