root password MySQL
Hey guys, I'm using the MySQL database and I changed the root password. I didn't mean to do it. Is there a way to find out the root password?
14 Replies
Project ID:
N/A
Where'd you change it?
I changed in the environment variables, in the MYSQL_ROOT_PASSWORD
Pretty sure it'll still work fine
You can just use the password you changed it to
I didn't change the root password, I tried to connect with another user I created and forgot to write down the root password, now I don't know it anymore.
oh, you can find the root password in the variables of your service
I edited there by mistake lol
yea I'm pretty sure that's fine
That's why I can't connect anymore
even when you use the password that you changed it to?
yeah
If the data is important then I think you can do the following to reset your MySQL settings:
1. Add a new MySQL deployment
2. Remove the previous MySQL deployment, leaving the volume containing the data behind
3. Delete the volume from the new MySQL deployment
4. Attach the old volume to the new volumeless MySQL deployment
5. Redeploy
WARNING: I haven't tested this in production environment to see if the data is maintained, I super recommend you wait for someone smarter than I am to pitch in, there is probably a better way to do this
thanks a lot man