mysql 5.7 修改 密码 报错?
ERROR 1054(42S22) Unknown column 'password' in ‘field list’
原因:
5.7 版本下的mysql数据库下已经没有password这个字段了,password字段改成了authentication_string
Mysql 忘记密码; 、停止 mysql
# /etc/init.d/mysql stop 、跳过验证登陆进入
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
执行之后 另开一个窗口;
root@datanode3: ~# mysql -u root mysql Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. MySQL Community Server (GPL) Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> UPDATE user SET Password=PASSWORD('123456') where USER='root';
ERROR 1054 (42S22): Unknown column 'Password' in 'field list' # 直接更改报错 需要一个 更改设置密码的参数 authentication_string
mysql> update mysql.user set authentication_string=password('') where user='root';
Query OK, row affected, warning (0.00 sec)
Rows matched: Changed: Warnings: mysql> flush privileges;
Query OK, rows affected (0.00 sec)