Each user has the right to change his or her own password, or that of someone else,
by using the SET PASSWORD statement.
SYNTAX:
SET PASSWORD [ FOR
= PASSWORD(
Example1:
set password for 'root'@'localhost'=passworf('new password')
example1:
Example 28.5: Change the password of SIVAGANESH to SIVAGANESH1.
SET PASSWORD FOR 'SIVAGANESH'= PASSWORD('SIVAGANESH1')
Explanation: In this statement, we assume that SIVAGANESH enters this statement himself.
If SIVAGANESH wants to change the password of another user, he needs to specify the
name of that user.
Example 28.6: Change the password of ROB to ROBSEC.
SET PASSWORD FOR ROB = PASSWORD('ROBSEC')
The below fig shows change root password in mysql command prompt
No comments:
Post a Comment