How to Change Password of a user in MySQL Server - MySQL DBA Tutorial

How to change password for a user/login in MySQL Server

To reset the password in MySQL for user , below statement can be used.

Syntax:

MySQL > SET PASSWORD FOR 'UserName'@'HostName' = 'NewPassword'

Example : 
Let's say that we have user TB and we want to change the password to 'Pass123#' , below statement can be used in MySQL Server to reset the password.


MySQL > SET PASSWORD FOR 'TB'@'localhost' = 'Pass123#';


you can also user statement to change the password in MySQL Server

MySQL > alter user 'username'@'HostName' identified by 'Password'   


MySQL Tutorial for beginners - How to change or reset password for user in MySQL Server

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.