Make new password for mysql user in 5 simple steps.
1.Stop mysql server:
#service mysql stop
2.Start in safe mode(use Ctrl+Z to send process to background):
#/usr/bin/mysqld_safe --skip-grant-tables --user=root &
3.Login as root:
#mysql -u root
4.Make mysql execute next queries:
UPDATE mysql.user SET Password=PASSWORD(’newpwd’) WHERE User=’root’; FLUSH PRIVILEGES; exit;
Where newpwd is a new password for mysql user “root”.
5.Restart mysql:
#service mysql restart
Now you are ready to connect to server with new password.