由于实际亲测以下命令不可行:
UPDATE user SET Password=PASSWORD WHERE user='root';
所以用下面这条命令可以成功修改mysql5.7密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY '!Password1';