zoukankan      html  css  js  c++  java
  • CentOS6.5_x64安装MySQL-5.6.17,在已经启动MySQL服务的情况下,出现密码报错ERROR 2002 (HY000)

    1、修改MySQL配置文件,使MySQL登陆时跳过密码验证

    skip-grant-tables

     

    2、重启MySQL服务

    service mysql restart

    3、进入MySQL,修改user表中的密码

    [root]#mysql -u root
    mysql> show databases;
    mysql> use mysql;
    mysql> update user set Password=password('root') where user = 'root';
    mysql>exit

    4、恢复MySQL配置文件,将刚才加入的代码行skip-grant-tables删除或者用#注释掉

    5、重启MySQL后,再次进入MySQL,用刚才修改过后的密码

    mysql -u root -proot

    6、再次设置数据库的密码

    mysql> SET PASSWORD=PASSWORD('root');

    7、重新进入MySQL数据库后,如果可以查看数据库,则完成密码重置

    大功告成~

  • 相关阅读:
    Codeforces 1230E
    扫描线求面积和周长 (模板,线段树)
    POJ2528
    线段树 (模板)
    Codeforces 1332B
    Codeforces 1279D
    Codeforces 1281B
    Codeforces 1288D
    8I
    8F
  • 原文地址:https://www.cnblogs.com/demonzyz/p/4462489.html
Copyright © 2011-2022 走看看