Skip to content

Instantly share code, notes, and snippets.

@zachbrowne
Created May 13, 2012 23:12
Show Gist options
  • Save zachbrowne/2690721 to your computer and use it in GitHub Desktop.
Save zachbrowne/2690721 to your computer and use it in GitHub Desktop.
Change WordPress Password via MySQL Command Line
Get an MD5 hash of your password.
Visit md5 Hash Generator, or...
Create a key with Python. or...
On Unix/Linux:
Create file wp.txt with the new password in it (and *nothing* else)
md5sum wp.txt
rm wp.txt
"mysql -u root -p" (log in to MySQL)
enter your mysql password
"use (name-of-database)" (select WordPress database)
"show tables;" (you're looking for a table name with "users" at the end)
"SELECT ID, user_login, user_pass FROM (name-of-table-you-found)" (this gives you an idea of what's going on inside)
"UPDATE (name-of-table-you-found) SET user_pass="(MD5-string-you-made)" WHERE ID = (id#-of-account-you-are-reseting-password-for)" (actually changes the password)
"SELECT ID, user_login, user_pass FROM (name-of-table-you-found)" (confirm that it was changed)
(type Control-D, to exit mysql client)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment