Changing mysql password

-- Use SET PASSWORD --
SET PASSWORD FOR 'user'@'host' = PASSWORD('newpass');

-- OR update statment --
UPDATE mysql.user SET Password=PASSWORD('123') WHERE User='user' AND Host='localhost';

-- remember to flush the user table --
FLUSH PRIVILEGES;

Leave a Reply

Your email address will not be published. Required fields are marked *