Change User Password in MySQL

Change User Password in MySQL

The SET PASSWORD statement allows changing the password for a user in the MySQL server. Provided password is interpreted as a clear text string. The password is passed to the authentication plugin associated with the user. The result returned by the plugin is stored in the authentication_string column of the mysql.user system table.

SET PASSWORD FOR myuser@localhost = 'new_pwd123';

A user's password can also be changed using the ALTER USER statement. The password is specified by IDENTIFIED BY clause.

ALTER USER myuser@localhost IDENTIFIED BY 'new_pwd123';

Leave a Comment

Cancel reply

Your email address will not be published.