How can you change the password of a MySQL user?

Posted by Prem Tiwari | Updated on

How can you change the password of a MySQL user?

SET PASSWORD statement is used to change the password of a MySQL user.

Syntax:

SET PASSWORD FOR ‘username’@’hostname’ = PASSWORD(‘password’);

Example:

The following statement will set or change the root password.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers