polr icon indicating copy to clipboard operation
polr copied to clipboard

how do i insert an admin user into my mysql database?

Open charon-gg opened this issue 5 years ago • 7 comments

pls help

charon-gg avatar Jan 21 '20 07:01 charon-gg

it fails to create one on setup, it gives me an error on the finish setup page but it lets me create an account and login.

charon-gg avatar Jan 21 '20 18:01 charon-gg

Same problem here. I'm on a shared hosting by OVH.

NickkoG avatar Jan 23 '20 13:01 NickkoG

Try the geolocation steps and after re-install the system!

https://github.com/cydrobolt/polr/issues/544#issuecomment-583918841

grfbr avatar Feb 10 '20 01:02 grfbr

@charon-gg open your mysql database, locate and open your "users" table and then change user "role" to "admin"

GomoDD avatar Jun 08 '20 21:06 GomoDD

as what @GomoDD stated, then logout and log back in fixed it for me.

x247nl avatar Jun 12 '20 09:06 x247nl

@GomoDD - Attached is the data I have in my users table - it's still not working, any idea? Screen Shot 2020-07-26 at 7 26 20 PM

I wasn't sure if I should have put in MD5 for the password or something. ANy help is much appreciated.

For what it's worth, I can confirm that in my install, it does hash the password in the database, which of course means the instructions about 'manually adding an admin user/pass is horribly oversimplified and missing a ton of instructions at best.

I did find a few tidbits in my attempts to install that might be useful:

  • I set up for open registrations. It's not what I ideally wanted, but I suspect the .env file can be changed later to disable that (not sure why not in the admin panel, but that's a different issue)
  • Made a new account with new password, then dropped into myphpadmin, and in the user table it indeed showed a hashed password for the new account. Typing 'admin' (no quotes) in the role field, and then logging out and back in did indeed give me admin access on that account.
  • After logging in to my site, I was able to see that the original account that I tried to make as an admin was 'inactive', which probably would have been a whole new issue even if the password was hashed in the database image
  • It looks like if the active field had been set to '1' that could have potentially addressed that issue too image

raindropworks avatar Mar 16 '21 21:03 raindropworks

@minakitty Not sure what's causing these issues during the creation of first (admin) account. I've set it up months ago and spent hours and hours troubleshooting issues and looking for documentation. I recently noticed that there's been an update aaand I'm sooo not looking forward to updating / upgrading. That is, if it's even possible .. (why? 1. I have some additional code 2. the documentation is poor).

You've resolved the issue now, right? by creating a second user and giving him an admin role? As for the ".env" file, yes, registrations and that kind of stuff can be modified later.

GomoDD avatar Mar 16 '21 22:03 GomoDD