mysql 报错ERROR 1820 (HY000):You must resetpassword

今天登录mysql(Server version: 5.7.11) 还是很好的,今天登录后执行任何命令都报下面的错误

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

解决办法
1、 修改用户密码
mysql> alter user ‘root‘@‘localhost‘ identified by ‘youpassword‘; ?

或者 ? ? ??

mysql>?set password=password("youpassword");
2、刷新权限
mysql> flush privileges;

mysql> help contents
You asked for help about help category: "Contents"
For more information, type ‘help <item>‘, where <item> is one of the following
categories:
? ?Account Management
? ?Administration
? ?Compound Statements
? ?Data Definition
? ?Data Manipulation
? ?Data Types
? ?Functions
? ?Functions and Modifiers for Use with GROUP BY
? ?Geographic Features
? ?Help Metadata
? ?Language Structure
? ?Plugins
? ?Procedures
? ?Storage Engines
? ?Table Maintenance
? ?Transactions
? ?User-Defined Functions
? ?Utility
mysql> show databases
-> ^C
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.01 sec)

mysql>
mysql>

问题解决,希望能帮助到大家。

原文地址:http://blog.51cto.com/victorly/2312619

时间: 2024-10-13 00:48:23

mysql 报错ERROR 1820 (HY000):You must resetpassword的相关文章

mysql 报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin

解决办法 1. 修改用户密码 mysql> alter user 'root'@'localhost' identified by 'youpassword'; 或者 mysql> set password=password("youpassword"); 2.刷新权限 mysql> flush privileges; 原文地址:https://www.cnblogs.com/ljl-blog/p/11540015.html

mysql报错ERROR 2003 (HY000): Can&#39;t connect to MySQL server on &#39;localhost&#39; (10061)

23:29:02/2017-05-03 现象描述:在Command Line Client可以登陆,但是在命令提示符cmd下登陆出错. 我最终的解决办法是: 我先去看了一下我的my.ini配置文件. 新版5.7的配置文件不是在安装目录,而是在programDat/mysql文件目录下 打开文件之后: 我在安装的时候修改了默认端口3306为8082, 在cmd登陆的时候仍然是默认端口登陆的,所以会报错.那么在登陆的 时候可以指定端口, -P一定要大写. mysql报错ERROR 2003 (HY0

长久不用的mysql报错ERROR 2002 (HY000): Can&#39;t connect to local MySQL server through socket &#39;/tmp/mysql.sock&#39; (2)

mac上安装过mysql: 然而,尝试连接时报错: $ mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 尝试去查看mysql.socket文件,发现没有.. $ which mysql /usr/local/bin/mysql 然后试试重启mysql: $ mysql.server start

mac 安装mysql 报错“ERROR 2002 (HY000): Can not connect to local MySQL server through socket &#39;/tmp/mysql.sock&#39; (2)” 解决办法

首先安装 homebrew 再 brew install mysql 之后连接 mysql 无论是登录还是修改初始密码都会报如下的错误 ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock' (2) 运行如下解决:参考 http://www.thinksaas.cn/group/topic/347978/ unset TMPDIR mysql_install_db --v

Mac brew 安装mysql 报错 ERROR 2002 (HY000): Can&#39;t connect to local MySQL server through socket

安装mysql 最新版 56 brew install mysql 启动报错 ben:~ soul$ which mysql /usr/local/bin/mysql ben:~ soul$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 解决办法 运行 ben:~ soul$ mysql.server start Starting MySQL .

MySQL5.7 报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement

MySQL5.7 报错 : ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement 需要重新设置密码.那我们就重新设置一下密码,命令如下: set password = password('123456'); 原文地址:https://www.cnblogs.com/Dev0ps/p/11738557.html

【MySQL笔记】mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法

step1:查看 1.1 Mysql命令行里输入"show engines:"查看innoddb数据引擎状态, 1.2 show variables "%_buffer%"里查看innodb_buffer_pool_size的数值,默认是8M(太小,需要改大一点!) step2:找配置文件,修改innodb_buffer_pool_size=64M 2.1 在linux里配置文件是my.cnf,windows里是my.ini(注:不是my-default.ini).

mysql 5.7密码报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

1.重新修改密码,语句如下: mysql> alter user 'root'@'localhost' identified by '123'; Query OK, 0 rows affected (0.00 sec) 2.如果修改过程出现错误(如下),转后面操作: mysql> alter user 'root'@'localhost' identified by '123'; ERROR 1819 (HY000): Your password does not satisfy the cu

解决MySQL报错ERROR 2002 (HY000)

今天在为新的业务线搭架数据库后,在启动的时候报错 [email protected]:/usr/local/mysql/bin# ./mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 在此记录一下,希望能够给遇到此问题的兄弟们提供一个解决问题的思路,有了思路后一步一步排查问题就比较容易了,但是我这个问题比较奇怪,如果有了解的兄