mysql破解密码

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:656

1.关闭mysql服务
[root@localhost ~]# service mysql stop
Shutting down MySQL..... [ OK ]
2.跳过授权表mysql.user 和 mysql.db
[root@localhost ~]# mysqld_safe --skip-grant-tables --user=mysql &
[1] 27937
121230 19:27:55 mysqld_safe Logging to '/usr/local/mysql/data/localhost.localdomain.err'.
121230 19:27:55 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
3.不用密码直接登录
[root@localhost ~]# mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.29-log Source distribution

Copyright (c) 2000, 2012, 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.
4.设置root密码
mysql> update mysql.user set password=password("123456") where user="root" and host = "localhost";
Query OK, 0 rows affected (0.01 sec)
Rows matched: 1 Changed: 0 Warnings: 0

mysql> exit
Bye

本文标签:
本文标题:mysql破解密码
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】