windows平台mysql密码破解设置
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了windows平台mysql密码破解设置,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1967字,纯文字阅读大概需要3分钟。
内容图文
![windows平台mysql密码破解设置](/upload/InfoBanner/zyjiaocheng/921/80f2b2969e824a7aa04a62b4a564c749.jpg)
windows平台下,5.7版本mysql,破解密码的两种方式:
#1 关闭mysql服务
net stop mysql
启动mysql服务 跳过权限
#2 在cmd中执行:mysqld --skip-grant-tables
另开一个cmd
#3 在cmd中执行:mysql
之前账号有密码的 不输入密码 可以进去
C:\Users\Administrator.QH-20170325TNQR>mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.41 MySQL Community Server (GPL) Copyright (c) 2000, 2018, 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> select user; ERROR 1054 (42S22): Unknown column 'user' in 'field list' mysql> select user(); +--------+ | user() | +--------+ | root@ | +--------+ 1 row in set (0.00 sec)
?
#4 执行如下sql:
更改之前mysql 密码
设置mysql库.user数据表 set设置密码 改为空
update mysql.user set authentication_string=password('') where user = 'root';
另外一种sql语句实现
update mysql.user set password=password("") where user="root" and host="l ocalhost";
执行完sql语句 执行这条语句让sql语句生效
刷新数据表 刷新权限
flush privileges;
把刚才mysql服务进程 kill掉
#5 tskill mysqld #或taskkill -f /PID 7832
查看mysqld 进程
C:\Users\Administrator.QH-20170325TNQR>tasklist |findstr mysqld mysqld.exe 7456 Console 1 456,020 K
kill 进程
C:\Users\Administrator.QH-20170325TNQR>taskkill -f /PID 7456 成功: 已终止 PID 为 7456 的进程。
#6 重新启动mysql
net start mysql
?
方式二
#1. 关闭mysql,可以用tskill mysqld将其杀死
#2. 在解压目录下,新建mysql配置文件my.ini
#3. my.ini内容,指定
[mysqld]
skip-grant-tables
#4.启动mysqld
#5.在cmd里直接输入mysql登录,然后操作
update mysql.user set authentication_string=password('') where user='root and host='localhost';
flush privileges;
#6.注释my.ini中的skip-grant-tables,然后启动myqsld,然后就可以以新密码登录了
?
?
?
内容总结
以上是互联网集市为您收集整理的windows平台mysql密码破解设置全部内容,希望文章能够帮你解决windows平台mysql密码破解设置所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。