👋 欢迎来到吴老二技术博客,专注运维 / 数据库 / 云原生
首页/数据库/正文

mysql修改密码报错

吴
吴老二
2020-03-17数据库2642 次浏览0 条评论
mysql已经安装好了,不过重置密码的时候使用update修改mysql的密码出现了报错,我的mysql是5.7版本的
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=password("root") where user="root";
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
这里提示,找不到'password',以前版本都是这样修改的,不过5.7版本需要使用'authentication_string'
mysql> update mysql.user set authentication_string=password('root') where user='root';
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.01 sec)
加了'authentication_string'mysql的密码就修改成功了。
文章底部广告位在后台「广告设置」填写广告代码后显示

评论 0

评论需 登录 后发表(注册并验证邮箱)。
还没有评论,来抢沙发~