xxxxxxxxxx
ALTER USER 'root'@'localhost' IDENTIFIED BY 'New-Password';
xxxxxxxxxx
ALTER USER 'user-name'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';FLUSH PRIVILEGES;
xxxxxxxxxx
SET PASSWORD FOR 'user-name'@'localhost' = PASSWORD('NEW_USER_PASSWORD');FLUSH PRIVILEGES;
xxxxxxxxxx
-- Assuming the user wants to change the password of a user named 'username' to 'newpassword'
-- Connect to MySQL server
mysql -u root -p
-- Change the password for the user 'username'
ALTER USER 'username'@'localhost' IDENTIFIED BY 'newpassword';
FLUSH PRIVILEGES;
xxxxxxxxxx
ALTER USER 'user-name'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';
FLUSH PRIVILEGES
xxxxxxxxxx
ALTER USER 'user-name'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';
FLUSH PRIVILEGES;
xxxxxxxxxx
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123';
xxxxxxxxxx
UPDATE mysql.user SET authentication_string=PASSWORD("rootpass") WHERE User='root';
xxxxxxxxxx
UPDATE mysql.user SET authentication_string = PASSWORD('NEW_USER_PASSWORD')WHERE User = 'user-name' AND Host = 'localhost';FLUSH PRIVILEGES;CopyCopyCopied!