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

vue-element-admin global loading waiting

Recent requirements: Global loading, all interfac...

Three ways to refresh iframe

Copy code The code is as follows: <iframe src=...

Summary of MySql import and export methods using mysqldump

Export database data: First open cmd and enter th...

HTML input file control limits the type of uploaded files

Add an input file HTML control to the web page: &...

Some things to note about varchar type in Mysql

Storage rules for varchar In versions below 4.0, ...

JavaScript to achieve stair rolling special effects (jQuery implementation)

I believe everyone has used JD. There is a very c...

Solve the problem of ifconfig being unavailable in docker

Recently, when I was learning docker, I found tha...

Vue implements three-dimensional column chart based on echarts

The three-dimensional column chart consists of th...

Summary of commonly used time, date and conversion functions in Mysql

This article mainly summarizes some commonly used...

js to achieve waterfall flow layout (infinite loading)

This article example shares the specific code of ...

17 excellent web designs carefully crafted by startups

Startups often bring us surprises with their unco...

How to change the character set encoding to UTF8 in MySQL 5.5/5.6 under Linux

1. Log in to MySQL and use SHOW VARIABLES LIKE &#...

Vue commonly used high-order functions and comprehensive examples

1. Commonly used high-order functions of arrays S...

Building FastDFS file system in Docker (multi-image tutorial)

Table of contents About FastDFS 1. Search for ima...