# 修改自己的密码 mysql> set password=password('newpassword');
# 修改别人密码——方法1 mysql> set password for 'username'@'host' = password('newpassword');
# 修改别人密码——方法2: 适用mysql5.7以前的版本,5.7以后的版本中mysql.user表没有了password字段 mysql> update mysq.user set password=password('newpassword') where user='user' and host='host';
# 修改别人密码——方法3:适用mysql5.7 mysql> update mysql.user set authentication_string=password('newpassword') where user='root';
# 修改别人密码——方法4 mysql> alter user 'test'@'%' identified by 'newpassword';