ITPub博客

首页 > 数据库 > MySQL > 破解本地 mysql 用户名和密码(转)

破解本地 mysql 用户名和密码(转)

原创 MySQL 作者:BSDLite 时间:2007-08-12 11:13:55 0 删除 编辑
破解本地 mysql 用户名和密码(转)[@more@]  Windows:

  1、用系统管理员登陆系统。

  2、停止MySQL的服务。

  3、进入命令窗口,然后进入 MySQL 的安装目录,比如我的安装目录是 c:mysql,进入 C:mysqlin

  4、跳过权限检查启动 MySQL, c:mysqlin>mysqld-nt --skip-grant-tables

  5、重新打开一个窗口,进入 c:mysqlin 目录,设置 root 的新密码

  c:mysqlin>mysqladmin -u root flush-privileges password "newpassword"

  c:mysqlin>mysqladmin -u root -p shutdown

  将 newpassword 替换为你要用的 root 的密码,第二个命令会提示你输入新密码,重复第一个命令输入的密码。

  6、停止 MySQL Server,用正常模式启动 Mysql

  7、你可以用新的密码链接到 Mysql 了。

  Unix 及 Linux:

  1、用 root 或者运行 mysqld 的用户登录系统;

  2、利用 kill 命令结束掉 mysqld 的进程;

  3、使用 --skip-grant-tables 参数启动 MySQL Server shell>mysqld_safe --skip-grant-tables &

  4、为 root@localhost 设置新密码 shell>mysqladmin -u root flush-privileges password "newpassword"

  5、重启 MySQL Server

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10617542/viewspace-949089/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    1872
  • 访问量
    4073880