Resetting user database via the SQL console
-
Hello all, I'm pretty new so please bear with me. I've searched around but can't find my answer. I'm trying to save an existing project which seems to have had some kind of issues and now it appears that the user login info is corrupt or something is broken. I have the SQL console all setup and running, I can see the users in the USERS table but cannot login to the main mango login page with any of the credentials I've been given. Is there a way I can reset the user passwords to blank or some known value via the console?
Thank you
Peter -
Or, let me ask a different question. Assuming this database is somehow corrupt, how could I save a bunch of the config info to copy into a new database?
-
I got this resolved if anyone wonders about this in the future.
To see the users run SELECT * FROM USERS
To set a user's password run
UPDATE USERS SET PASSWORD = '{NONE}password' WHERE USERNAME = 'admin' -
Thanks for posting that up there @psysak Sorry I didn't see this post before you called yesterday.
For anyone else reading this, make sure you change the password in the Mango UI afterwards so the password is not stored in the database in plaintext.
-
This strategy for recovery only works after Core 2.8 as in Core 2.7 passwords were all SHA1 hashes and they were not marked as such.
-
Just to further elaborate, PASSWORD = '{NONE}password' would result in the password being reset to "password" in Code 2.8+. However, I have a version 2 system so the '{NONE...' portion doesn't work. Instead, I have to get a SHA1 result for a password I want to enter, such as the word "password", run it through a hex to base64 converter and enter that into the PASSWORD field. :)