• 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)

     

    修改密码成功。

  • 相关阅读:
    原码、补码、反码
    处理器体系结构
    CSAPP学习笔记—虚拟内存
    Sequence Models
    Neural Networks and Deep Learning
    windows7_下Eclipse中部署tomcat7.0进行JSP+servlet开发
    used in key specification without a key length
    在jsp页面下, 让eclipse完全支持HTML/JS/CSS智能提示
    求知若饥,虚心若愚
    C指针右左法则
  • 原文地址:https://www.cnblogs.com/tom-plus/p/6597737.html
Copyright © 2020-2023  润新知