Monday, July 16, 2012

Setting a Password for Mysql Account


This is the other way on how to change the user account password. By the use of SET PASSWORD statement, you will be able to change the password. You can set a password for the user you're connected as follows:
Set password=password(‘passpass’);
 See the image above, before I declare a new password, I used “password” as my password. Now, the current password is “passpass”. It overwrites the old password to a new one.
Take note: you have use this syntax to change password when you are currently logged in to account that you want to change the password.





I exited the user account with the old password “password”. Now I am going to log-in again but see the changes, the “password” before was “passpass” now.



Take note: You cannot set a new password when you are currently using the account that you want to change the password account.
 I have created new user account richard with the current password “father”. Next, I want to set new password for user richard. The password “father” will now set to “chaplong” as shown the above example.




No comments:

Post a Comment