今天上午遇到了一个问题,新创建的mysql5.7的数据库,由于初始化有点问题,没有给root密码,用了免密码登录。

但是,修改了root密码之后,把配置中的免密登录的配置注释掉后,重启服务。服务正常启动,用修改后的密码也可以正常登录,

但是执行任何操作,都提示:

mysql > show databases;

ERROR 1820  (HY000): You must reset your password using ALTER USER statement before executing

我嘞个懵逼了,为啥出现这个错误啊!

后来找了很多帖子,其中有一个完美解决了问题:

参考官方的一个文档,见http://dev.mysql.com/doc/refman/5.6/en/alter-user.html。如下操作后就ok了:

mysql> SET PASSWORD = PASSWORD('123456'); 
Query OK, 0 rows affected (0.03 sec)

【MySQL】ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing的更多相关文章

  1. 第一次登录mysql,使用任何命令都报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

    问题: 使用临时密码登录成功后,使用任何myql命令,例如show databases;都提示下面的报错 ERROR 1820 (HY000): You must reset your passwor ...

  2. MySQL用户密码过期登陆报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

    今天接到主从复制失败告警,查看MySQL,发现MySQL能够登陆但是执行命令报错, ERROR 1820 (HY000): You must reset your password using ALT ...

  3. MySQL root账户密码设为“root”后执行命令提示ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

    修改root账户密码为“root”后,提示ERROR 1820 (HY000): You must reset your password using ALTER USER statement bef ...

  4. MySQL:ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

    解决方法: 修改密码:alter user 'root'@'localhost' identified by '123456'; mysql> use mysql; ERROR 1820 (HY ...

  5. MySQL数据库使用报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

    今天MySQL数据库,在使用的过程中一直报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement be ...

  6. 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 exe ...

  7. tar格式 方法安装MySQL后,初次登录出现 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement

    参考: https://www.cnblogs.com/kerrycode/p/4368312.html http://blog.csdn.net/u014520039/article/details ...

  8. ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

    看图:

  9. mysql5.7初始化密码报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before

    mysql初始化密码常见报错问题1,mysql5.6是密码为空直接进入数据库的,但是mysql5.7就需要初始密码 cat /var/log/mysqld.log | grep password1 2 ...

随机推荐

  1. SQL Server NULL值用法及处理详解

    用法如下: 1.如果表中的某个列是可选的,那么我们可以在不向该列添加值的情况下插入新记录或更新已有的记录,这意味着该字段将以 NULL 值保存. 2.NULL 用作未知的或不适用的值的占位符. 3.定 ...

  2. android adb命令* daemon not running.starting it now on port 5037 * 问题解决

    输入adb devices却出现了问题daemon not running.starting it now on port 5037, 2. 原因: adb的端口(5037)被占用了.至于这个5037 ...

  3. Core3.0返回的Json数据大小写格式问题

    前言 测试发现,CoreWebAPI返回的Json数据,会将字段的首字母转换为小写, 经百度得,返回数据会默认驼峰命名,导致的. 随即百度, https://www.cnblogs.com/cdone ...

  4. 4.自定义view-进度条控件

    1.效果 2.实现原理 画圆,画圆弧,画文字 外部控制进度,通过invalidate()方法更新 核心代码: @Override protected void onDraw(Canvas canvas ...

  5. Weblogic命令执行漏洞(CVE-2018-2628)复现

    一.漏洞环境搭建 CVE-2018-2628影响的软件版本为: Weblogic 10.3.6.0 Weblogic 12.1.3.0 Weblogic 12.2.1.2 Weblogic 12.2. ...

  6. Python基础(上篇)

    本篇文章主要内容:变量.注释.运算符.关键字.数据类型. 在入手变量之前我们先来看看经典的编程语句 → hello world 在python3中输出到控制台的函数是print() print(&qu ...

  7. 发送微信通知 java 实现

    /实现类 @Service public class WeChatServiceImpl implements IWeChatService { @Override public WeChatSend ...

  8. java 合并两个list 并去重

    //两个list合并并去除重复 public static void main(String[] args) throws Exception { List list1 =new ArrayList( ...

  9. 表单序列化json字符串和js时间格式化

    js时间格式化 new Date().format("时间格式") Date.prototype.format = function(fmt) { var o = {        ...

  10. python-使用python获取一段录音

    需要安装pyaudio库. 直接上代码: import pyaudio import wave AUDIO_FILE = '录音文件.wav' def get_audio(filepath, audi ...