Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Talk:Resetting Your Password

The following instructions are from the Answers-Installation page (merged by request) regarding how to reset your password through the MySQL/MariaDB command line. Since I'm not familiar with the process, and it looks like the one already posted. I'm not sharp enough with the code to tell if there is a difference.

Would someone double check this information and either post the corrections or replace the following with what is posted? Thanks.

=== For Command Line MySQL/MariaDB ===

You might have direct access to your MySQL/MariaDB database from the command line. Usually this is done by sitting at your server, connecting directly to your server via SSH, or using the MySQL client on your workstation to connect to your server. You must be in the correct context to successfully execute the mysql command mentioned below.

To reset your WordPress password from the MySQL/MariaDB command line, do the following (replace the options in italics with your settings):

  1. "mysql -u root -p" (Logs in to MySQL/MariaDB)
  2. Enter your password at the prompt.
  3. "use name-of-database" (Selects your WordPress database)
  4. "show tables LIKE '%users';" (Finds the WordPress user table)
  5. "SELECT ID, user_login, user_pass FROM name-of-table-you-found WHERE user_login = 'username';" (Observe the encrypted password)
  6. "UPDATE name-of-table-you-found SET user_pass=MD5('new-unencrypted-password') WHERE user_login = 'username';" (Updates the database with the encrypted password)
  7. "SELECT ID, user_login, user_pass FROM name-of-table-you-found WHERE user_login = 'username';" (Confirm that it was changed)
  8. "exit" (Exits the MySQL client)
  9. Login to WordPress using the username and password that you've altered.

Lorelle 21:53, 30 Jan 2005 (GMT)


EDIT ADDITION - I realized (because I needed the info) that we hadn't supplied the most basic information on how to change your password within WordPress, so I added it. Lorelle 00:45, 12 Feb 2005 (GMT)