Changing MySQL root password

There are several ways of changing the root password of MySQL. Initially, when mysql in first accessed, there are no passwords for the root access, which we all know is not always a good practice. The user root is MySQL’s admin user account, same as in linux/unix.

Using mysqladmin

$ mysqladmin -u root password NEWPASSWORD

If you already have an existing password to root, you may change it by:

$ mysqladmin -u root -p OLDPASSWORD password NEWPASSWORD

This can also be used in changing passwords for normal users:

$ mysqladmin -u username -p OLDPASSWORD password NEWPASSWORD

Using mysql command

Another way is by changing the stored password of users within mysql command.

Login to mysql command:

$ mysql -u root -p

Change to mysql database, since this is where we need to do some changes.

mysql> use mysql;

Use mysql commands to update the password of a user, eg. lhan:

mysql> update user set password=PASSWORD("NEWPASSWORD") where User='lhan';

Reload privileges:

mysql> flush privileges;

Happy Birthday Dad!

It might be late, but my dad’s birthday was yesterday, September 22, exactly 1 week after my mom’s birthday. Love you both, and we miss you so much. We are looking forward in seeing you again here in Phil, hopefully next year. 🙂

A special day….

I just want to greet my wife a Happy 5th year anniversary. Thanks for all the care and understanding through all the years. Also, I want to greet the other woman in my life, my Mom. Even though we are far apart from you and papa (they’re in US), you’re teachings are always with us. We love you and miss you so much. We are looking forward to see you again ma, hopefully next year. 🙂