1.使用特定的命令
命令:SET PASSWORD FOR 'username'@'host' = PASSWORD('newpassword'); 例子:SET PASSWORD FOR 'test'@'localhost' = PASSWORD("test");
2.使用常规的更新SQL语句
update mysql.user set authentication_string=password("newpassword") where User="test" and Host="localhost"; flush privileges;