How to reset the password for a Liferay Portal user

Overview

If you need to reset the password for a Liferay Portal user in the database, refer to the following test steps.

Test Environment

These steps assume the following:

  • We are connecting to a MySQL database server.

  • User is stored in Liferay Portal database.

  • We are using default auth (not LDAP or SSO).

Test Steps

1/ Connect to Liferay Portal database schema


2/ Identify user who forgot their password

e.g.

select * from User_;


e.g.

select userId, screenName from User_;

Scan rows/columns for user by name or email address.


Locate target entry by "userId" or "screenName".

We will assume the user ID for our user is "10178" and screen name is "test".


3/ Confirm user by selecting user by their user ID or screen name

e.g.

select * from User_ where userId='10178';


eg.

select * from User_ where screenName='test';

 

4/  Reset password to default for user by user ID


We will reset the password to default "test".

e.g.

update User_
set password_='test', passwordEncrypted=0, passwordReset=0
where userId='10178';

e.g.

update User_
set password_='test', passwordEncrypted=0, passwordReset=0
where screenName='test';

 

5/ Commit user password change

e.g.

commit;

 

6/ Confirm new user password by selecting user using their user ID.


e.g.

select * from User_ where userId='10178';

e.g.

select * from User_ where screenName='test';

 

7/ Clear Liferay Portal database cache and/or restart Liferay Portal server

Clear portal caches.

8/ Login as user and user, then use Control Panel to reset password to something else


9/ Change the user ID and default password to suit.