My personal blog..

All about IT and other things. Enjoy!

Reset the MySQL Root Password

For every database, you should set the root or su passwords to something other than the default, unless you want to get hacked. For mysql, the system administrator user is usually called root, but sometimes it’s called admin or something else.

linux-terminal

Here’s the method to reset / change root password just for MySQL server without changing root pass on system:

From your favourite terminal 🙂

mysqladmin -u root password newpassword
mysqladmin -u root -h host_name password newpassword

Example of reset / change root password to something memorable like loved wasabi 😉 …

mysqladmin -u root password W@s@b!y219:
mysqladmin -u root -h localhost password W@s@b!y219:

You will also want to restart the database server after running this command

sudo /etc/init.d/mysql restart

Enjoy your new MySQL with wasabi!

Posted in Linux, MySql