February 5, 2010

Change MySQL password as non-root user

Filed under: Uncategorized — hrishi @ 10:30 pm

If you do not have root access for a MySQL database, then to change your password do this ->

[hrish@somehost ~]$ mysql -u hrish -p
Enter password:
mysql>  select current_user();
| current_user()     |
|hrish@localhost |
1 row in set (0.00 sec)
mysql>set password for ‘hrish’@’localhost’ = password(‘newpassword’);
Query OK, 0 rows affected (0.00 sec)

You will have to use the new password when you login next.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: