Is there away of changing admin password through mysql?

I forgot my admin password and unfort my email server isnt up yet and I cant get my password.. Is there away to change the admin pass hash to a well known one that way i can log in and change the pass


Try to make a new admin.
set it up as super-admin
and remove the original admin as super-admin.

Then login to the acp, and change the pass on the first admin you forgot pass for.

Login as that one. reset it as super admin, and undo the other super-admin, and delete the temporary created super admin ?

Jake Bunce

XenForo moderator
Staff member
The password information is serialized in the database so you can't update it with simple SQL.

In my testing I found that this works:

1) Register a new account. You need a working username and password.

2) Run this query on your database to flag that user as an admin:

Rich (BB code):
UPDATE xf_user
SET is_admin = 1
WHERE user_id = 3;
3) Edit the library/config.php file and specify that user as a super admin:

Rich (BB code):
$config['superAdmins'] = '3';
Separate by commas if there are multiple super admins:

Rich (BB code):
$config['superAdmins'] = '1,2,3';
4) Now you can login to the Admin CP with full access. If you want the new admin to be permanent then you should setup proper admin permissions:

Admin CP -> Users -> Administrators -> Create New Administrator

Or you can edit the password for the old admin to regain access to that account:

Admin CP -> Users -> Search for Users -> [find the account, edit the password]