Name

SET PASSWORD

Synopsis

SET PASSWORD [FOR 'user'@'host'] = PASSWORD('password')

Use this statement to change the password for a user. If the FOR clause is not given, the current user is assumed. The PASSWORD( ) function will encrypt the password given. This statement does not require the use of the FLUSH PRIVILEGES statement. It will automatically update the privileges cache for the new password.

SET PASSWORD FOR 'kenneth'@'localhost' = PASSWORD('password');

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.