linux安装完mysql后修改了密码不能登陆

安装完mysql后用初始密码登陆进去,然后修改了user表的密码
update mysql.user set authentication_string=SHA1('root') where us
er='root';

退出来重启了mysql服务后用新的密码就登不上去了一直报错

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

为什么使用SHA1()呢??

你的加密用错了,应该是Password()函数,而不是SHA1()函数

8.0.15版本已经不支持了