美文网首页
愚蠢的人类忘记了mysql root的密码

愚蠢的人类忘记了mysql root的密码

作者: woodsouthmmm | 来源:发表于2017-04-20 18:17 被阅读0次

    stop the MySQL server (two ways)

    • open the monitor,kill the mysql(for me, it didn't work).
    • open the system preference - mysql, click the bottom "stop"

    reset the password

    sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables

    open another terminal

    $sudo /usr/local/mysql/bin/mysql -u root

    input the system password

    $ UPDATE mysql.user SET authentication_string=PASSWORD('新密码') WHERE User='root';
    $FLUSH PRIVILEGES;
    $\q

    ref

    http://devlu.me/2016/01/18/Mac%E4%B8%8B%E9%87%8D%E7%BD%AEMysql%E7%9A%84root%E5%AF%86%E7%A0%81/
    https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html( the manual documentation seems complicated but more detailed.

    相关文章

      网友评论

          本文标题:愚蠢的人类忘记了mysql root的密码

          本文链接:https://www.haomeiwen.com/subject/viwlzttx.html