How to solve the "Unknown column 'password" Error When resetting the root password in MySQL, rootcolumn
In the evening, I opened the MAC and found that the root account suddenly failed to log on to MySQL. So I planned to reset the password. After reading a few articles, I got the Unknown column 'Password' error, the table structure of the user does not have this field. It was found that the field name was changed after MySQL was upgraded, and the password name was changed to authentication_string. After knowing the cause, follow the following command to successfully reset the root password.
$ Sudo mysql. server stop # first shut down the normal MySQL service $ sudo mysqld_safe -- skip-grant-tables # skip MySQL authentication $ sudo mysql-uroot-p # When the password is prompted, press ENTER to ENTER mysql command line mysql> use mysql; mysql> update user set authentication_string = password ('newpassword') where user = 'root'; mysql> exit; $ sudo mysql. server start # start the MySQL service again, and you can use the new password to log on normally.
The MySQL version for Mac is:
Mysql Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64) using EditLine wrapper
The above is a small series of solutions to the MySQL reset root password prompt "Unknown column 'password", I hope to help you, if you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!