Mysql修改用户密码错误

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='’; #修改密码成功

Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1

mysql> flush privileges; #立即生效

Query OK, 0 rows affected (0.00 sec)

mysql> quit

你可能感兴趣的:(MySql)