After MySQL login is successful, use the command
update user set password=password("1234") where user="root";
ERROR: ERROR 1054 (42S22) Unknown column ‘password’ in ‘field list’
D:\DevelopTools\mysql-5.7.10-winx64\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.10 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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> use mysql
Database changed
mysql> update user set password=password("1234") where user="root";
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
I checked the data and found that after MySQL5.7, the password field no longer exists, it turns into Authentication_string
update user set authentication_string=password("1234") where user="root";
The command to modify again is ok. Do not forget to flush MySQL privileges with the flush privileges command after the
modifications.
mysql> update user set authentication_string=password("1234") 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.00 sec)
When does
mysql need “flush” privileges?The
flush privileges command essentially disconnects the user information/privilege Settings in the current user and privilige table from the mysql library (the built-in library of the mysql database) into memory. If MySQL user data and permissions have been modified and you want to take effect without restarting the MySQL service, you need to execute this command. After changing the Settings of the ROOT account in case you cannot log in again after restarting, flush directly to see if the permissions are valid. Without taking too much risk.
Resources:
https://blog.csdn.net/u014756827/article/details/53164926
Read More:
- MySQL error 1054 (42s22) unknown column ‘password’ in ‘field list’
- MySQL password setting error message: error 1054 (42s22): unknown column ‘password’ in ‘field list’
- Unknown column ‘Password‘ in ‘field list‘
- MySQL unknown column ‘in’ field list ‘solution
- How to Fix SQL Error: 1054, SQLState: 42S22 Unknown column ‘markcardex0_.art_service_time’ in ‘field list’
- Cause: java.sql.BatchUpdateException: Unknown column ‘xxx‘ in ‘field list‘
- MySQL error: column ‘ID’ in field list is ambiguous
- Mysql reports an error Operand should contain 1 column(s)
- MySQL error operation should contain 1 column (s)
- MySQL error — multiple methods of failed to find valid data directory and MySQL setting password appear
- MySQL startup problem (ERROR 1045 (28000): Access denied for user’ODBC’@’localhost’ (using password: NO))
- MySQL – ERROR 1146 (42S02): Table ‘mysql.user’ doesn’t exist
- MySQL forgot the root password
- Error 1136 (21s01): column count doesn’t match value count at row 1
- Error 1064 in MySQL password change
- MySQL 8 — error in setting simple password error 1819 (HY000): your password does not satisfy the current policy requirements
- Error (1820) if the password is not changed in time after MySQL installation
- Error attempting to get column ‘xxxxx’ from result set — after Lombok is annotated with builder, mybatis cannot recognize the correct type of field
- MySQL appears: ERROR 1049 (42000): Unknown database’XXX’ solution
- mysql ERROR 1050 (42S01): Table already exists