Get the App
SLTechnology News&Howtos  ›  Database  › 

Mysql5.7.18.1 modified user password error ERROR 1054 (42S22):

Shulou Source: shulou.com Published: 2022-06-01 17:36:23 09月19日 Update

Mysql > update user set password=password ("new password") where user= "user name"; error ERROR 1054 (42S22) Unknown column 'password' in' field list' after execution

The reason for the error is that the password field is no longer available in the mysql database in version 5.7, and the password field has been changed to authentication_string.

So please use the following command:

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; # here is the query user command-| User |-| * | mysql.sys | | root | * rows in set (0.00 sec) mysql > update user set password=password ("*") where user= "*" # change password error ERROR 1054 (42S22): Unknown column 'password' in' field list'mysql > update mysql.user set authentication_string=password ('*') where user='*'; # change password successfully Query OK, 1 row affected, 1 warning (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 1

Mysql > flush privileges; # effective immediately

Query OK, 0 rows affected (0.00 sec)

Mysql > quit

Bye

N > mysql-u *-p # successfully logged in with this user.

Enter password:

...

Mysql >

Tags: User password success command field reason data database version user name error new password query login Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Xiaomi Redmi Docker Shulou Information