how do i insert an admin user into my mysql database?
pls help
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.
Same problem here. I'm on a shared hosting by OVH.
Try the geolocation steps and after re-install the system!
https://github.com/cydrobolt/polr/issues/544#issuecomment-583918841
@charon-gg open your mysql database, locate and open your "users" table and then change user "role" to "admin"
as what @GomoDD stated, then logout and log back in fixed it for me.
@GomoDD - Attached is the data I have in my users table - it's still not working, any idea?
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

- It looks like if the active field had been set to '1' that could have potentially addressed that issue too

@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.
