tags:

views:

37

answers:

1

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!

+2  A: 

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.

baol
Thanks for the tip about back-up scripts and cron jobs, I'll do some snooping in there and see what I can come up with. The application accesses the database through a user with only 'usage' privileges, so no luck there. In the event I have to top mysql and restart, do you know if other existing (non root) users be affected? (Most importantly the one being used by the application)
jonathonmorgan
Other users will not be affected (other than not being able to access the database while it's shut down).
Tomislav Nakic-Alfirevic