I've inherited development for a website on vps hosting, and have login info for a user with sudo privileges, but don't have the password for the mysql root user. After digging around a little, it looks like the only way to fix this is to stop mysql (something like this: http://waoewaoe.wordpress.com/2010/02/03/recover-reset-mysql-root-password/). But because the website it's serving is currently in production, I'm hoping you guys can enlighten me to any potential consequences (or let me know if there's typically a file where the password would be accessible开发者_如何学运维).
a) during the time mysql is stopped, information in the database won't be accessible, right -- even by other users?
b) will resetting the root password have any impact on other users after mysql has restarted? Will their username/passwords still be valid? The current application is using an account with limited privileges to read/write to the database, and while 5min downtime in the middle of the night would probably go unnoticed, half a day while I tie up loose ends/figure out what I screwed up will land in me hot water.
Thanks in advance for your help!
You can look after back-up scripts and cron jobs. Maybe some script does a dump using the root account. If this is the case the password needs to be stored in cleartext. You can also look at configuration files of application that use the database.
You also need to be lucky. If you are not, you have to stop mysql, change the password and start it again.
精彩评论