User Tools

Site Tools


bigace:administration:reset-user-passwort-with-sql

Reset a users password with SQL

This article describes quickly how you can find a user in the database and how you can reset a password with plain SQL.

You need to find out your Community ID first, which you can see in the administration, the Community config file or in the hidden page footer. Please insert this CID in the next SQL queries where you see {CID}.

Please also extend the tablename “user” with the database prefix if you use one.

Find (a) user in the database

Find all in the Community:

SELECT * FROM USER WHERE cid = {CID};

Find one user by its email:

SELECT * FROM USER WHERE cid = {CID} AND email = '{EMAIL}';

Replace {EMAIL} with the real email-adress.

Reset a users password

The SQL to change one user in the database is the following:

UPDATE USER SET password = md5('{PASSWORD}') WHERE cid = {CID} AND id = {ID};

Replace {PASSWORD} with the new password and {ID} with the ID you just found out with one of the “search queries” above.

bigace/administration/reset-user-passwort-with-sql.txt · Last modified: 2010/10/15 00:08 by kevin