MySQL - How to set password for the root

Go to MySQL bin directory and use mysqladmin command to set password

mysqladmin -u root password sasikala

then login as

mysql -u root -psasikala

To change the root password

mysqladmin -u root -pold_password password new_password

The new password will be set to the root user.