Home > Database > Mysql Tutorial > Why is My MySQL 5.7 Root Password Update Failing with \'Unknown column \'password\' in \'field list\'\'?

Why is My MySQL 5.7 Root Password Update Failing with \'Unknown column \'password\' in \'field list\'\'?

Barbara Streisand
Release: 2024-12-03 13:49:11
Original
834 people have browsed it

Why is My MySQL 5.7 Root Password Update Failing with

MySQL User DB Missing Password Columns

Problem:

While attempting to update the MySQL root password, the error message "Unknown column 'password' in 'field list'" appears, indicating that the password column does not exist in the user table.

Explanation:

In MySQL 5.7, the password column in the mysql.user table has been removed, and the authentication details are now stored in the 'authentication_string' column.

Solution:

  1. Connect to the MySQL database as the root user:
mysql -u root
Copy after login
  1. Select the MySQL database:
USE mysql;
Copy after login
  1. Verify that the user table exists:
SHOW TABLES;
Copy after login
  1. Examine the user table structure:
DESCRIBE user;
Copy after login
  1. You will notice that the 'password' column is missing, replaced by the 'authentication_string' column.
  2. Update the root user's password using the 'authentication_string' column:
UPDATE user SET authentication_string = PASSWORD('1111') WHERE user = 'root';
Copy after login

Additional Notes:

  • MySQL 5.7 introduces significant changes compared to previous versions.
  • For more information on MySQL 5.7 updates, refer to the official documentation: [What's New in MySQL 5.7](https://dev.mysql.com/doc/refman/5.7/en/whats-new-in-5-7.html)

The above is the detailed content of Why is My MySQL 5.7 Root Password Update Failing with \'Unknown column \'password\' in \'field list\'\'?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template