change wordpress password manually

Reset wordpress password using provided link not work, sadly no phpmyadmin available 🙂

Fortunately I have shell access which is enough, using built in md5 function to generate and update the password, here’s the steps:

1. Creating md5

– Using shell

Just type :

md5 -s your chosen password

– Make php script with this content :

<?php

$string=’your chosen password’;

echo md5($string);

?>

save this script and execute on your server.

2. Update wordpress table

– Using shell

login to mysql with username and password that written in wp-config.php

mysql -uusername -ppassword -pdatabase_name;

use database_name;

update user table set password=’md5 generated hash’ where username=’current_username’;

– Using php script

Make this script

<?php

$con=mysql_connect(“localhost”,”username_db”,”password_db”);

$choose=mysql_select_db(“db_name”);

//updating table

$update=mysql_query(“update table_user set password=’md5 generated hash’ where username=’current_username'”);

?>

save this script as change.php, upload to server and execute.

Done.

I can login to my wordpress account again.

Tags: