linux环境MySQL密码破解
密码破解
针对密码忘记的情况
1、如果是普通用户,可以让管理员授权(root)
alter user 'cali'@'%' identified by 'xxxx';
2、如果是超级用户
第1步:停止MySQL进程的运行
[root@mysql-2 mysql]# service mysqld stop
Shutting down MySQL.. SUCCESS!
[root@mysql-2 mysql]#
第2步:修改配置文件
[root@mysql mysql]# vim /etc/my.cnf
[mysqld]
user=mysql #指定启动MySQL进程的用户
skip-grant-tables #跳过密码验证
#validate-password=off #需要禁用密码复杂性策略
第3步:启动MySQL进程
[root@mysql mysql]# service mysqld start 启动MySQL进程
Starting MySQL. SUCCESS!
[root@mysql-2 mysql]#
第4步:登录MySQL,不接密码
[root@mysql-2 mysql]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.25 Source distributionCopyright (c) 2000, 2019, 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>
mysql> alter user 'root'@'localhost' identified by 'xxxx'; --》会报错
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql> flush privileges; 刷新权限(会加载原来没有加载的权限表--》用户名和密码所在的表user等)
Query OK, 0 rows affected (0.01 sec)mysql> alter user 'root'@'localhost' identified by 'xxxx'; --》会报错
ERROR 1133 (42000): Can't find any matching row in the user table
mysql> set password for 'root'@'localhost' = 'xxxx'; --》修改密码,指定用户名为root@localhost
Query OK, 0 rows affected (0.00 sec)root@(none) 10:35 scmysql>alter user 'root'@'localhost' identified by 'Sanchuang123#';
Query OK, 0 rows affected (0.00 sec)root@(none) 10:40 scmysql>
mysql里完整的用户信息是 用户名@主机名mysql> quit
Bye
第5步:重新修改mysql的配置文件
[mysqld]
socket=/data/mysql/mysql.sock
#user=mysql --》注释掉
#skip-grant-tables --》注释掉
第6步:刷新服务
[root@mysql-2 mysql]# service mysqld restart #重新刷新服务
Shutting down MySQL.. SUCCESS!
Starting MySQL. SUCCESS!
[root@mysql-2 mysql]#
第7步:验证修改密码是否成功
[root@mysql-2 mysql]# mysql -uroot -p'xxxx'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.25 Source distributionCopyright (c) 2000, 2019, 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>
3、另外一种方式:
使用其他的管理员账号给别的用户重新设置密码
可以在SQLyog里操作(windows)SET PASSWORD FOR 'root'@'localhost' = 'Sanchuang123#';
alter user 'root'@'localhost' identified by 'Sanchuang123#';
linux环境MySQL密码破解相关推荐
- [分享]运维分享一一阿里云linux系统mysql密码修改脚本
[分享]运维分享一一阿里云linux系统mysql密码修改脚本 大象吃豆子 级别: 小白 发帖 12 云币 27 加关注 写私信 只看楼主 更多操作楼主 发表于: 2014-09-30 编写 ...
- 操蛋的linux改mysql密码(1054和1819错误)
最近买了阿里云的linux服务器,帮我装好tomcat,jdk,mysql镜像,不怎么会用,在朋友帮助下勉强启动,但是初始的mysql密码太过复杂.看了网上linux修改mysql密码的教程鱼龙混杂, ...
- Linux重置Mysql密码_解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost
Linux重置Mysql密码 一般这个错误是由密码错误引起,解决的办法自然就是重置密码. 假设我们使用的是root账户. 1.重置密码的第一步就是跳过MySQL的密码认证过程,方法如下: #vim / ...
- linux系统mysql密码忘记了怎么办_Linux中MySQL密码忘了怎么办
Linux中MySQL密码忘了怎么办 1.首先编辑/etc/my.cnf文件vim /etc/my.cnf 在文件中加入一行配置skip-grant-tables 例如加到这个位置# read_rnd ...
- Linux修改mysql密码
Linux修改mysql密码 前提:知道原密码的情况下修改密码 sudo mysqladmin -u root -p password 'test121212
- Kali Linux渗透测试——密码破解
笔记内容参考安全牛课堂苑房弘老师的Kali Linux渗透测试教程 当目标系统无任何已知漏洞时,可以考虑社会工程学或者获取目标系统的用户身份,通过合法账户登录绕过系统的安全防线.账户登录身份认证包括账 ...
- RuoYi-Cloud 部署篇_01(linux环境 mysql+nginx版本)
文章目录 一.基础准备 1. 技术选型 2. 源码克隆 3. 安装依赖 4. 将 RuoYi-Cloud 项目导入到 IDEA 5. 安装启动Mysql 6. 安装启动Redis 7. 创建数据库,执 ...
- linux忘记mysql密码_Linux下忘记Mysql密码的找回方法(图)
Mysql隔一段时间不访问,也许你会忘记访问密码,这时该怎么办,重装mysql吗?这个代价也太大了,我们这里介绍两种恢复密码的方法. 方法一:因为Mysql密码存储于数据库mysql中的user表中, ...
- 修改linux中mysql密码,Linux下修改Mysql密码的三种方法
首先,我也是新手刚刚了解Linux系统,因为同事离职,所以就只能接手!然后员工离职肯定要改密码啦!废话不多说,下面我截图写一下流程! 我刚开始也是找教程,网上教程一大堆基本都是可行的! 修改Linux ...
最新文章
- android html.fromhtml 字体加粗,Android Html设置TextView的颜色、加粗样式
- n个数进栈后输出的可能序列数
- 机器学习第3天:多元线性回归
- 笔记-软考高项-错题笔记汇总1
- 【嵌入式】Libmodbus之RTU模式Slave端程序示例
- The following module was built either with optimizations enabled or without debug information - winz
- python3(十三)File对象的属性
- TFS中的工作项(六)
- Chrome DevTools的Network面板
- Ado.Net 实体类、数据连接类、数据访问类
- 八皇后(N皇后)问题
- win10 mfc 连接mysql_win10下使用c语言连接mysql
- 第一次冲刺个人博客04
- Yii2中自带分页类实现分页
- html 页面的分析与设计,HTML+CSS网页设计教程
- C#中背景图片布局设置
- 关于透明图像的滤色处理要注意的几个点
- 知云文献,Endnote简易使用指南
- OSPF基础工作过程
- 【不定时推荐】这些年读过的书第一本--《一个人的朝圣》