Change WordPress Account Passwords

Introduction

I sometime lose or forget the WordPress admin account password. (Account passwords and other information is stored in a MySQL table.) Here are MySQL commands that can be used to change WordPress account passwords.

A Windows Batch File That Executes The MySQL Command Line

If you are doing anything with MySQL on a windows system, it is sometimes nesessary (and usefull) to use the command line interface. The following windows batch file simplifies starting the command line interface.

Using notepad, copy to the following code to the file mysql.bat. Double click of the file and the command line will execute.

@echo off
rem =========================================================
rem MySQL command line
rem =========================================================

set MYSQL=C:\xampp\mysql\bin\mysql.exe

%MYSQL% --table -h localhost -u root -padminpassword

pause

Note:

Some Useful MySQL Commands

mysql> show databases;

mysql> create database databasename;

mysql> drop database databasename;

mysql> use databasename;

Change WordPress Account Password

mysql> use WPdatabasename;

mysql> select Id,user_login,user_pass from wp_users where user_login="admin";

mysql> update wp_users set user_pass=MD5('newpassword') where Id=1;