How-To Geek
How to Change a User Password on MySQL Server
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:
use mysql;
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.
Got Feedback? Join the discussion at discuss.howtogeek.com
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



