Directly modifying the database is not advised because we are unable to provide assistance regarding the damage it might do. The suggested approach in these cases is a groovy script that uses Liferay's API.
Environment
- Liferay DXP 7.0
- Liferay DXP 7.1
- Liferay DXP 7.2
Resolution
Here is a simple script that uses the deleteUser method of UserLocalServiceUtil. ***** needs to be replaced with the long userID.
import com.liferay.portal.kernel.service.UserLocalServiceUtil;
import com.liferay.portal.kernel.model.User;
try
{
UserLocalServiceUtil.deleteUser(*****);
}
catch(Exception e)
{
out.println("ERROR is"+e.getMessage());
}