zoukankan      html  css  js  c++  java
  • MySQL5.7关于密码二三事

    MySQL5.7关于密码二三事

    第一个:update user set password=password('root') where user='root' and host='localhost';语句无用

    在5.7的user表中没有了password这个列名,改为了authentication_string,所以修改用户登入的密码语句为

    update user set authentication_string=password('root') where user='root' and host='localhost';

    第二个: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 before executing this statement.

    原因:MySQL5.7对于密码安全的要求限制,所以你要修改root密码,要不设置符合它要求的密码,或者修改其默认配置

    下面是修改它默认配置的方法

    首先,修改validate_password_policy参数的值

    mysql> set global validate_password_policy=0;

    Query OK, 0 rows affected (0.00 sec)

    validate_password_length(密码长度)参数默认为8,我们修改为1

    mysql> set global validate_password_length=1;

    Query OK, 0 rows affected (0.00 sec)

    完成之后再次执行修改密码语句即可成功

    mysql> alter user 'root'@'localhost' identified by 'root';

    Query OK, 0 rows affected (0.00 sec)

    神坑的事情,修改密码的时候不提醒我,进入操作以后再说,我都登录进来了,这样密码,还有什么安全性??

  • 相关阅读:
    C语言函数指针
    C语言动态申请内存
    C语言指针的常见错误
    C语言指针和数组的关系
    jni c语言使用指针交换两个值
    求两条线段的交点
    利用Opencv在PictureControl中显示照片
    根据反射解析和转换DataRow
    快速排序代码备份
    OpenCV常用图像操作和鼠标操作(双11版本)
  • 原文地址:https://www.cnblogs.com/hahayixiao/p/10429415.html
Copyright © 2011-2022 走看看