zoukankan      html  css  js  c++  java
  • linux平台mysql密码设破解

    1.先停止mysql服务

    service mysqld stop

     

    2.启动mysql服务 并跳过权限认证

     mysqld_safe --skip-grant-tables

    3.打开另外一个终端

    登录mysql

    [root@mysql ~]# mysql -uroot -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 1
    Server version: 5.1.73 Source distribution
    
    Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    mysql> 

    4.修改原来mysql的密码

    update mysql.user set password=password("") where user = "root" and host = "127.0.0.1";
    执行完sql语句 执行这条语句让sql语句生效
    刷新数据表 刷新权限 flush privileges;

    5.杀死刚才启动的mysql服务
    pkill -9 mysql

    6.开启mysql服务器

    service mysqld start

     
  • 相关阅读:
    sql server中count(*),count(col),count(1)的区别
    oracle 存储过程(1)
    Java线程:概念及原理
    H2 应用实例2
    H2 应用实例1
    H2 database 应用
    H2 database 操作操作内存表
    JDK 环境变量配置
    MySQL CREATE TRIGGER (1)
    MySQL 事务1
  • 原文地址:https://www.cnblogs.com/mingerlcm/p/9745482.html
Copyright © 2011-2022 走看看