Resource icon

Password Reset Query

Jake Bunce

Well-known member
Jake Bunce submitted a new resource:

Password Reset Query (version 1.x) - A database query to reset a user's password. Useful for recovery of admin login.

You can use this query to reset a user's password. It is especially useful if you forget your admin password.

You need to replace new-password and 1 (the user_id). You don't have to change salt, but if you do then both instances need to be the same.

Rich (BB code):
UPDATE xf_user_authenticate
SET data = BINARY
	CONCAT(
		CONCAT(
			CONCAT('a:3:{s:4:"hash";s:40:"', SHA1(CONCAT(SHA1('new-password'),...

Read more about this resource...
 
Jake,
I just finished the xenforo install, and I've already lost the administrator password. I tried using the query you posted, and though it was performed successfully, I still couldn't log in using the new set password.
 
Jake,
I just finished the xenforo install, and I've already lost the administrator password. I tried using the query you posted, and though it was performed successfully, I still couldn't log in using the new set password.

Is there an error? Does it say the login is incorrect?

The query works fine in my testing. Maybe you specified the wrong user_id or ran the query on the wrong database or something.
 
Well it just said wrong password. I checked the query 3 times to make sure that the user_id, password and database is correct. But nevermind the problem is solved now. I reinstalled xenForo and started with a new database.
 
Jake, how would I add a new user through the database? I added myself to the xf_user by copying another user already on the database, than I also added myself to the xf_authenticate and used the query u provided above, but It keeps saying my password is wrong :/

Thanks in advance!
 
Jake, how would I add a new user through the database? I added myself to the xf_user by copying another user already on the database, than I also added myself to the xf_authenticate and used the query u provided above, but It keeps saying my password is wrong :/

Thanks in advance!

http://xenforo.com/community/threads/script-to-create-a-new-user.21286/#post-270084

If you are missing the joined record in any of those tables then it might result in "user not found" kind of errors.
 
@Jake Bunce - im unable to respond to your reply on my review. My point was that your instructions say you should "replace" 1. But quite often "1" is "admin".

So it should not necessarily be replaced. This confused me because it is a big part of the very short instructions.

My Admin ID was 1, so I wasn't supposed to change it, and I felt like I was not following the instructions.

I'd recommend saying:

"Replace 1 with whatever user ID is associated with your Admin account. If it is already 1, you do not need to change this".
 
Jake Bunce submitted a new resource:

Password Reset Query (version 1.x) - A database query to reset a user's password. Useful for recovery of admin login.



Read more about this resource...

Background: Ive forgotten the admin password, got caught with the Google Capta issue so cant reset it, and updating from V1.x to V2.1 .. but the install update needs the admin name and password. I am a Xenforo/SQL newbie.

Questions:
1) I assume that this is a SQL query? ( said I was a newbie)
2) How does one determine what the admin user_id IS? Is it always "1"? If not, how would one list the user ids to find it?
 
1) yes it's an SQL query.
2) typically the first user is an admin. You could also check the config.php file to see who is a super admin. Editing that config is also a way to make another user account super admin.
 
Last edited:
Btw, this worked to remove all the passwords:
Code:
#delete passwords
UPDATE example_xenforo.xf_user_authenticate SET data =  '';
This dont work in 1.5.24, any ideia why?

#1146 - Table 'example_xenforo.xf_user_authenticate' doesn't exist
 
Last edited:
in the 1.5.24 show scheme_class =XenForo_Authentication_Core12 and not scheme_class = 'XenForo_Authentication_Core', can i use with your command or i need to change scheme_class to XenForo_Authentication_Core12?
 
I guess you could do it via phpmyadmin. I don't use that myself. I ssh into my database server.

Be sure you have a backup of your database in case anything goes wrong.
 
Top Bottom