Changing a password for a particular user is really easy, you’ll just need to be root or have the admin password for the database. You can do it from the command line, or from a GUI if you prefer.
First, connect to the database:
mysql –uroot –p
Then, switch to the mysql internal database:
Then execute the actual command:
update user set password=PASSWORD(“NEWPASSWORD”) where User=’username’;
You could always combine this into a single step:
mysql –uroot –pPass mysql –e “update user set password=PASSWORD(‘NEWPASSWORD’) where User=’username’;”
Enjoy your new changed password.
Programmer by day, geek by night, The Geek, also known as Lowell Heddings, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on Google+ if you'd like.
- Published 12/14/09