基于Linux下的mysql密码破解

您所在的位置:网站首页 phpmyadmin用户名和密码是什么 基于Linux下的mysql密码破解

基于Linux下的mysql密码破解

2023-07-11 04:25| 来源: 网络整理| 查看: 265

第1步:停止MySQL进程的运行

[root@mysql ~]# service mysqld stop Shutting down MySQL.... SUCCESS!

第2步:修改配置文件 在[mysql]中添加以下字段:

[root@mysql mysql]# vim /etc/my.cnf [mysqld] user=mysql #指定启动MySQL进程的用户 skip-grant-tables #跳过密码验证

第3步:启动MySQL进程

[root@mysql mysql]# service mysqld start 启动MySQL进程 Starting MySQL. SUCCESS!

第4步:登录MySQL,不接密码,输入密码过程直接回车,然后修改密码:

[root@mysql-2 mysql]# mysql -usc -p mysql> alter user 'sc'@'%' identified by 'Sanchuang123#'; --》会报错 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) root@(none) 10:35 scmysql>alter user 'sc'@'%' identified by 'Sanchuang123#'; Query OK, 0 rows affected (0.00 sec) 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]# [root@mysql-2 mysql]# mysql -usc -p'Sanchuang1234#'

另外一种方式: 就是使用其他的管理员账号给别的用户重新设置密码

可以在SQLyog里操作 SET PASSWORD FOR 'root'@'localhost' = 'Sanchuang123#';


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3