博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql 5.7 修改root密码报错
阅读量:7040 次
发布时间:2019-06-28

本文共 1513 字,大约阅读时间需要 5 分钟。

**mysql5.7.18.1修改用户密码报错ERROR 1054 (42S22): Unknown column 'password' in 'field list'解决办法

本意向修改一个用户的密码,命令为如下

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 -u root -pEnter password: ********Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 12Server version: 5.7.18-log MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> use mysql;Database changedmysql> select User from user;  #此处为查询用户命令+-----------+| User      |+-----------+| *******  || mysql.sys || root      |+-----------+rows in set (0.00 sec)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: 1mysql> flush privileges;  #立即生效Query OK, 0 rows affected (0.00 sec)mysql> quitByen>mysql -u ******* -p #以该用户登录成功.Enter password: ********…………………………mysql>

转载于:https://blog.51cto.com/sgk2011/2311631

你可能感兴趣的文章
openssl创建自己的CA certificate
查看>>
linux环境中,如何通过手动创建crontab文件的方式来设置crontab定时调度任务?
查看>>
Ajax实例
查看>>
zookeeper快速入门
查看>>
PHP 获取当地准确时间
查看>>
【装机知识】电源知识整理
查看>>
Python学习笔记
查看>>
OFFICE--三线表的制作
查看>>
php smarty模版引擎中的缓存应用
查看>>
ImportError: numpy.core.multiarray failed to import
查看>>
代码,显示IPhone剩余磁盘空间
查看>>
wf跟webx开源我见
查看>>
如何使用 log4net 以日期为文件名输出(转载)
查看>>
delphi演示程序
查看>>
iOS进阶:Objective-C runtime(一)
查看>>
Hash
查看>>
Tomcat version 7.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 and 6 Web mod
查看>>
实现点击a标签页面跳转后颜色高亮
查看>>
关于php中checkbox的操作特殊点
查看>>
当用户切换了窗口后改变title,感觉挺有趣的,收藏了
查看>>