SEARCH

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.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 12/14/09

Enter Your Email Here to Get Access for Free:

Go check your email!