How to solve the "Unknown column 'password" Error When resetting the root password in MySQL, rootcolumn

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.