How to solve the problem "Unknown column 'password" when resetting MySQL root password

How to solve the problem "Unknown column 'password" when resetting MySQL root password

When I turned on my MAC at night, I found that the root account suddenly could not log in to MySQL normally, so I planned to reset the password. After reading several articles, I found that the reset was unsuccessful and I always got the error of Unknown column 'password'. I looked at the user table structure and found that there was indeed no such field. After checking, 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 reason, you can successfully reset the root password by following the command below.

$sudo mysql.server stop #Shut down the normal MySQL service first$sudo mysqld_safe --skip-grant-tables #Skip MySQL authentication$sudo mysql -uroot -p #When prompted for the password, just press ENTER to enter the MySQL command linemysql>use mysql;
mysql>update user set authentication_string=password('newpassword') where user='root';
mysql>exit;
$sudo mysql.server start #Restart the MySQL service and you can log in normally with the new password

The MySQL versions for Mac are:

mysql Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64) using EditLine wrapper

The above is the solution to the "Unknown column 'password" prompt when resetting the root password of MySQL. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • What should I do if I forget my MySQL password? How to reset MySQL root password
  • Detailed method for forgetting the root password or resetting the password in Mysql 5.7
  • How to reset the root password in mysql8.0.12
  • How to reset MySQL root password under Windows
  • Reset mysql root password in linux system
  • How to reset the root user password of MySQL database if you forget it [Graphic]
  • How to reset the root password of Mysql in Windows if you forget it
  • Complete steps to reset the root user password in mysql8
  • The easiest way to reset mysql root password
  • A practical record of MySql resetting the root password and failing

<<:  Virtual machine clone Linux centos6.5 system network card configuration graphic tutorial

>>:  How to use VIM editor in Linux

Recommend

Detailed steps for installing MinIO on Docker

Table of contents 1. Check whether the docker env...

A brief discussion on the semantics of HTML and some simple optimizations

1. What is semanticization? Explanation of Bing D...

Example code showing common graphic effects in CSS styles

Let me briefly describe some common basic graphic...

Analyzing the four transaction isolation levels in MySQL through examples

Preface In database operations, in order to effec...

How to fix the four sides of the table to scroll up, down, left and right

question: When I was doing project statistics rec...

How to use CSS counters to beautify ordered lists of numbers

In web design, it is very important to use an org...

When the interviewer asked the difference between char and varchar in mysql

Table of contents Difference between char and var...

Solution to MySQL replication failure caused by disk fullness

Table of contents Case scenario Solving the probl...

MySQL 5.7.20 compressed version download and installation simple tutorial

1. Download address: http://dev.mysql.com/downloa...

Summary of Vue's monitoring of keyboard events

Key Modifiers When listening for keyboard events,...

HTML blockquote tag usage and beautification

Blockquote Definition and Usage The <blockquot...

jQuery+swiper component realizes the timeline sliding year tab switching effect

Result: Implementation code: Need to be used with...

React hooks pros and cons

Table of contents Preface advantage: shortcoming:...