zoukankan      html  css  js  c++  java
  • MySQL5.7更改密码时出现ERROR 1054 (42S22): Unknown column 'password' in 'field list'

    转自:http://blog.csdn.net/u010603691/article/details/50379282

    新安装的MySQL5.7,登录时提示密码错误,安装的时候并没有更改密码,后来通过免密码登录的方式更改密码,输入update mysql.user  set password=password('root') where user='root'时提示ERROR 1054 (42S22): Unknown column 'password' in 'field list',原来是mysql数据库下已经没有password这个字段了,password字段改成了

    authentication_string

    所以更改语句替换为update MySQL.user set authentication_string=password('root') where user='root' ;即可

    我的系统版本如下:


    完整的更改MySQL密码的方式如下:

    1、vim /etc/my.cnf 加入skip-grant-tables


    2、重启MySQL, /etc/init.d/mysqld restart


    3、终端输入 mysql 直接登录MySQL数据库,然后use mysql


    4、update mysql.user set authentication_string=password('root') where user='root' ;



    A.update user set password=password("123456") where user="root";//该接口经测试可用

    mysql5.7更改密码应该采用命令 ALTER USER 'root'@'localhost'IDENTIFIED BY '********'其中密码的命名规则有所改变,详见

    http://blog.csdn.net/u010603691/article/details/50541979

    5、编辑my.cnf文件删掉skip-grant-tables 这一行,然后重启MySQL,/etc/init.d/mysqld restart,否则MySQL仍能免密码登录

    6、mysql -u root -p

    然后输入密码即可登录MySQL数据库


  • 相关阅读:
    八皇后问题
    窃贼问题
    汉诺塔算法
    HDOJ(HDU) 1570 A C
    HttpClient4.2 Fluent API学习
    CUDA编程(六)进一步并行
    动态规划-迷宫-百度之星-Labyrinth
    hdu 5288||2015多校联合第一场1001题
    [单调队列] hdu 3415 Max Sum of Max-K-sub-sequence
    java 内存数据存储
  • 原文地址:https://www.cnblogs.com/x_wukong/p/5817146.html
Copyright © 2011-2022 走看看