Solution to MySQL server login error ERROR 1820 (HY000)

Solution to MySQL server login error ERROR 1820 (HY000)

Fault site: Log in to the MySQL server and get this error no matter what command you execute

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> use test;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
...
...

How could this happen? Am I on a fake server?

Cause analysis: This is mainly controlled by a parameter default_password_lifetime, see the official explanation


Look carefully, the Note information is sometimes more useful than the above information (I usually ignore the English notes, but it is possible that the part you ignore may also help performance)

Problem solving: In the open source world, we are not afraid of errors, because only when errors are reported can we have solutions. Let's take a look at your environment.

mysql> select version();
+--------------+
| version() |
+--------------+
| 5.7.10-3-log |
+--------------+
1 row in set (0.01 sec)
 
mysql> show variables like 'default_password_lifetime';
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| default_password_lifetime | 360 |
+---------------------------+-------+
1 row in set (0.00 sec)

I see. Then change the password.

alter user user() identified by "123456";

The problem was successfully solved! The current user can successfully execute commands within the scope of his permissions.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • MySQL bypasses granting information_schema objects and reports ERROR 1044 (4200) error
  • mysql databasemysql: [ERROR] unknown option ''--skip-grant-tables''
  • How to solve the 10060 unknow error when Navicat remotely connects to MySQL
  • Ubuntu 18.0.4 installs mysql and solves ERROR 1698 (28000): Access denied for user ''''root''''@''''localhost'''
  • ERROR 2002 (HY000): Can't connect to local MySQL server through socket ''/tmp/mysql.sock''
  • Solve MySQL startup error: ERROR 2003 (HY000): Can't connect to MySQL server on ''localhost'' (10061)

<<:  Detailed explanation of permission management commands in Linux (chmod/chown/chgrp/unmask)

>>:  Detailed steps for building a React application with a Rails API

Recommend

MySQL 5.7.17 installation and configuration tutorial under Linux (Ubuntu)

Preface I have installed MySQL 5.6 before. Three ...

Use CSS to achieve circular wave effect

I often see some circular wave graphics on mobile...

Three.js sample code for implementing dewdrop animation effect

Preface Hello everyone, this is the CSS wizard - ...

Detailed example of MySQL (5.6 and below) parsing JSON

MySQL (5.6 and below) parses json #json parsing f...

How to smoothly upgrade nginx after compiling and installing nginx

After nginx is compiled and installed and used fo...

Summary of commonly used CSS encapsulation methods

1. pc-reset PC style initialization /* normalize....

Nginx+FastDFS to build an image server

Installation Environment Centos Environment Depen...

A guide to writing flexible, stable, high-quality HTML and CSS code standards

The Golden Rule Always follow the same set of cod...

How to build a MySQL high-availability and high-performance cluster

Table of contents What is MySQL NDB Cluster Preli...

Detailed explanation of CSS image splicing technology (sprite image)

CSS image splicing technology 1. Image stitching ...

How to use JavaScript to get the most repeated characters in a string

Table of contents topic analyze Objects of use So...

Detailed analysis of the blocking problem of js and css

Table of contents DOMContentLoaded and load What ...

How to allow external network access to mysql and modify mysql account password

The root account of mysql, I usually use localhos...

Example code of how to implement pivot table in MySQL/MariaDB

The previous article introduced several methods f...