Locked myself out of Wordpress
Archived
Written in October 2012. Kept as it was, so versions, links and details may be out of date.
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 -pSHOW 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.