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)

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

  • 相关阅读:
    XML解析技术:Dom4j浅析
    log4j详解
    更改IP 脚本(自动获取和手动设置多个IP),将内容拷贝到记事本另存为bat批处理文件
    MyEclipse 导出 javadoc 乱码解决
    一个好用的树dhtmlXTree
    Java语法总结 线程
    常用log4j配置
    使用 dom4j 解析 XML
    java调用webservice .
    Love Google 谷歌不能用的的解决方法
  • 原文地址:https://www.cnblogs.com/hahayixiao/p/10429415.html
Copyright © 2011-2022 走看看