zoukankan      html  css  js  c++  java
  • mac下连接本地安装的mysql报错提示密码过期

    前提:

    mac中之前安装了mysql,一段时间没使用,今天使用mysql客户端去连接,报错提示密码过期,原因是mysql5.7之后版本有密码过期这个功能。

    error:

    Your password has expired. To log in you must change it using a client that supports expired passwords.

    打开终端,启动mysql服务:

    sudo /usr/local/mysql/support-files/mysql.server start

    打开另外一个终端:

    输入:

    yingmuxiaogedeMacBook-Air:~ yingmuxiaoge$ alias mysql=/usr/local/mysql/bin/mysql

    yingmuxiaogedeMacBook-Air:~ yingmuxiaoge$ mysql -u root -p

     

    输入如下尝试修改密码失败:

    mysql> update mysql.user set password=PASSWORD('root') where User='root';  

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

     

    根据提示信息,使用如下去修改密码:

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

    Query OK, 0 rows affected (0.00 sec)

     

    mysql>  flush privileges;

    Query OK, 0 rows affected (0.01 sec)

     

    修改密码成功。

  • 相关阅读:
    跨域在前端工程化中的实际解决方案。
    细说Vue作用域插槽,匹配应用场景。
    js数据结构之栈和队列的详细实现方法
    js数据结构之hash散列的详细实现方法
    js数据结构之集合的详细实现方法
    js数据结构之二叉树的详细实现方法
    【好记性不如烂笔头】之小程序要点记录
    回想继承、原型与原型链有感
    js数据结构之链表(单链表、双向链表、循环链表)
    js数据结构之列表的详细实现方法
  • 原文地址:https://www.cnblogs.com/tom-plus/p/6597737.html
Copyright © 2011-2022 走看看