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

A brief discussion on the mysql execution process and sequence

Table of contents 1:mysql execution process 1.1: ...

How to migrate local mysql to server database

We can use the scp command of Linux (scp cannot b...

Introduction to the usage of exists and except in SQL Server

Table of contents 1. exists 1.1 Description 1.2 E...

How to deal with too many Docker logs causing the disk to fill up

I have a server with multiple docker containers d...

Solution to ERROR 1366 when entering Chinese in MySQL

The following error occurs when entering Chinese ...

Analysis of the principle and usage of MySQL continuous aggregation

This article uses examples to illustrate the prin...

HTML+CSS3 code to realize the animation effect of the solar system planets

Make an animation of the eight planets in the sol...

A Deep Understanding of Angle Brackets in Bash (For Beginners)

Preface Bash has many important built-in commands...

Vue implements Dialog encapsulation

Table of contents Vue2 Writing Vue3 plugin versio...

How to choose transaction isolation level in MySQL project

introduction Let's start with our content. I ...

Introduction to MySQL role functions

Table of contents Preface: 1. Introduction to rol...

Detailed explanation of the process of using GPU in Docker

Table of contents Download tf-gpu Build your own ...

Vue encapsulation component tool $attrs, $listeners usage

Table of contents Preface $attrs example: $listen...

Windows Server 2008 Tutorial on Monitoring Server Performance

Next, we will learn how to monitor server perform...