本文主要強調修改密碼的sql語句變化。如果是root密碼忘記了,請參考Mysql忘記root密碼怎么解決
Mysql 5.7以前修改密碼
update mysql.user set password=password('123456') where user='newuser' and host='localhost';
flush privileges;
Mysql 5.7以后修改密碼
update mysql.user set authentication_string=password('123456') where user='newuser' and host='localhost';
flush privileges;