• MySQL5.7出现Your password has expired. To log in you must change it using a client that supports expir


    今天晚上本来想写bootstrap-fileinput插件集成fastdfs的文章,但是刚启动idea里面的QiYuAdmin就出现了错误: 
    Your password has expired. To log in you must change it using a client that supports expired passwords.其实只需要修改密码就可以了,这个问题我找到了以下解决办法:

    1、修改 /etc/my.cnf,在 [mysqld] 小节下添加一行:skip-grant-tables=1

    这一行配置让 mysqld 启动时不对密码进行验证

    2、重启 mysqld 服务:systemctl restart mysqld

    3、使用 root 用户登录到 mysql:mysql -u root

    4、切换到mysql数据库,更新 user 表:

    update mysql.user set authentication_string=password(‘root’) where user=’root’ and Host = ‘localhost’;

    flush privileges;

    在之前的版本中,密码字段的字段名是 password,5.7版本改为了 authentication_string

    5、退出 mysql,编辑 /etc/my.cnf 文件,删除 skip-grant-tables=1 的内容

    6、重启 mysqld 服务,再用新密码登录。但此时还是不行哦,我以为可以了,就没有往下看了。其实还有最后一步。

    7、alter user ‘root’@’localhost’ identified by ‘root’;

    有个疑问,不知道为什么程序是一直链接不上的,但是客户端,比如Navcat和MySQL的WorkBench都是可以链接上的?最后一段我是直接在Navcat里面执行的

  • 相关阅读:
    每天删除和创建表
    一种直接取数的建表语句
    正则替换函数regexp_replace()
    将同个id对应的多行数据,转为一行数组类型数据。使用collect_set() group by函数
    根据客户端标识加载不同的css文件
    配置npm镜像
    解决方案
    oracle virtualbox设置asm虚拟硬盘
    scala基础
    excel合并sheet内容
  • 原文地址:https://www.cnblogs.com/wangmo/p/8360104.html
Copyright © 2020-2023  润新知