While attempting to modify the root password in MySQL, you may encounter an error message stating that the user table's password column is unknown. This anomaly, however, is not a bug.
In MySQL 5.7, the password field in the user table has been renamed to authentication_string. This change reflects a shift in password management to improve security.
To confirm this and troubleshoot the issue:
Select the mysql database:
mysql> use mysql;
Show the tables:
mysql> show tables;
Describe the user table's structure:
mysql> describe user;
To modify the password, simply execute the following command, replacing 1111 with your desired password:
update user set authentication_string=password('1111') where user='root';
Beyond the password column change, MySQL 5.7 introduced other significant enhancements. For a comprehensive overview of these changes, refer to the documentation: [What's New in MySQL 5.7](https://dev.mysql.com/doc/refman/5.7/en/news-5-7.html)
The above is the detailed content of Why is there no `password` column in the MySQL 5.7 `user` table?. For more information, please follow other related articles on the PHP Chinese website!