Content last modified Tuesday 24 August 2021
hop to #bottom
Categories:
Author:
Author's website
About It:
Rate it:
  • Helpful?
  • 6 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

Password reset in MYSQL database

There may be instances in which you or another user on your Textpattern site loses their login password, or you may find that in your webhost’s transition from MYSQL 4.0 to 4.1, your Textpattern password no long works. Apparently the password function in 4.0 creates a 16 character password while 4.1 creates a 40 characters password.

Textpattern passwords are encrypted in the database, so you can’t quite just go in and see/replace the passwords with anything you’d like. But here’s what you can do:

If you have a textpattern install with a password that you’ve forgotten/misplaced/lost the scrap of paper you wrote it down on, you can edit one of the users via mysql and change the password field to:

930d0177e9cb358cfc78dd550b

Then log in with the password:

Passw0rd
(that’s a zero, not an OH)

The other way to do it is to run the following query in phpMyAdmin:

UPDATE txp_users SET pass = PASSWORD('newpass') WHERE name = 'loginName';

or

UPDATE PFXtxp_users SET pass = password('NEW_PASSWORD') WHERE user_id = 'USER_ID_OF_USER'

where PFX is the prefix you set in your TXP config (make sure you wrap the whole thing in backticks, though not doing so probably won’t have an effect), NEW_PASSWORD is the new password you want, wrapped in single quotes. USER_ID_OF_USER is the user_id of the user whose password you want to reset.

Thanks to “Ray”: ryanschwartz and greenrift for these answers.

Marcus Geiger has written instructions in German.

Article Request Count:
Posted here:
27 Feb 2005

You know you want to visit the Archives.
Published with Textpattern