caffeine

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.

Create a free website or blog at WordPress.com.