zoukankan      html  css  js  c++  java
  • mysql数据忘记库密码

    忘记数据库密码

    • 1、/etc/my.cof文件中添加第一行 skip-grant-tables
    • 2、重启服务 systemctl restart mysqld
    • 3、mysql不需要密码直接登录
    • 4、修改密码 set password=password('123123');
    • 5、刷新 flush privileges;
    • 6、注释掉/etc/my.cof文件中添加的一行 #skip-grant-tables
    • 7、重启服务 systemctl restart mysqld

    第二种方法

    1、关闭数据库
    2、启动数据库到维护模式
    mysqld_safe --skip-grant-tables --skip-networking &
    3、mysql 直接进入数据库
    4、修改密码 alter user root@'localhost' identified by '1';
    5、报错 ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
    6、 flush privileges;
    7、再次修改密码  alter user root@'localhost' identified by '1';
    8、退出 重新启动数据库
    
  • 相关阅读:
    1.Hibernate配置
    CKEditor/FCKEditor的使用
    介绍一个好用的工具类库commons-beanutils
    SpringBean.xml配置
    MVC框架显示层——Velocity技术
    mysql CMD命令
    day 05
    day 04
    day03
    python day 02
  • 原文地址:https://www.cnblogs.com/jiangyatao/p/11008434.html
Copyright © 2011-2022 走看看