You are here

How to change password of MySQL account?

You can change the password of MySQL account using one of the following ways:

(a) connect to your MySQL account at 'localhost':

step 1a: start up MySQL:
mysql -u -p

step 2a: change your MySQL account password at 'localhost':
MySQL> set password for <mysql_accountname>=password('newpassword');

step 3a: disconnect from MySQL:
MySQL> quit;

(b) connect from another system from HKU network to the computer 'www.<domainname>.hku.hk (mysql access is available from HKU network only):

step 1b: start up MySQL:
mysql -u <mysql_accountname> -p -h www.<domainname>.hku.hk

step 2b: change your MySQL account password at 'www.<domainname>.hku.hk' :
MySQL> set password for <mysql_accountname>=password('newpassword');

step 3b : disconnect from MySQL :
MySQL> quit;

Service Category: