I want to reset mysql root password but I don't want to log into mysql and then reset the password just as follows,
mysql -u root
FLUSH PRIVILEGES;
SET PASSWORD FOR root@'localhost' = PASSWORD('password');
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
Is there a way to achieve this using external command or something?
Best Answer
Replace x.x with your current mysql server version.
Than it will prompt for a new password.