美文网首页
MySQL密码修改

MySQL密码修改

作者: 丁功春 | 来源:发表于2018-07-15 10:43 被阅读0次

mysql> update user set password=password(“新密码”) where user=”用户名”;

执行后报错  ERROR 1054(42S22) Unknown column 'password' in ‘field list’

错误的原因是 5.7版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string,而网上大多还是原来的命令

所以请使用一下命令:

mysql> update mysql.user set authentication_string=password('*******') where user='*******'; #修改密码成功

mysql> flush privileges; #立即生效

相关文章

网友评论

      本文标题:MySQL密码修改

      本文链接:https://www.haomeiwen.com/subject/rhfppftx.html