修改用户的密码,网上搜到的命令为如下
执行后报错 ERROR 1054(42S22) Unknown column ‘password‘ in ‘field list’
错误的原因是 5.7版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string
所以请使用一下命令
>mysql -u root -p Enter password: ********
mysql> use mysql; Database changed
mysql> update user set password=password("*******") where user="*******"; #修改密码报错 ERROR 1054 (42S22): Unknown column ‘password‘ in ‘field list‘ 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
此博文非原创
原文地址:https://www.cnblogs.com/God-is-with-me/p/10197812.html
时间: 2024-10-04 12:28:04