2019独角兽企业重金招聘Python工程师标准>>>

<?php
require('./wp-blog-header.php');function meh() {
global $wpdb;if (isset($_POST['update'])){$user_login = ( empty( $_POST['e-name'] ) ? '' : sanitize_user( $_POST['e-name'] ) );$user_pass  = ( empty( $_POST[ 'e-pass' ] ) ? '' : $_POST['e-pass'] );$answer = ( empty( $user_login ) ? '<div id="message" class="updated fade"><p><strong>The user name field is empty.</strong></p></div>' : '' );$answer .= ( empty( $user_pass ) ? '<div id="message" class="updated fade"><p><strong>The password field is empty.</strong></p></div>' : '' );if ( $user_login != $wpdb->get_var("SELECT user_login FROM $wpdb->users WHERE ID = '1' LIMIT 1") ){$answer .="<div id='message' class='updated fade'><p><strong>That is not the correct administrator username.</strong></p></div>";}if( empty( $answer ) ){$wpdb->query("UPDATE $wpdb->users SET user_pass = MD5('$user_pass'), user_activation_key = '' WHERE user_login = '$user_login'");$plaintext_pass = $user_pass;$message = __('Someone, hopefully you, has reset the Administrator password for your WordPress blog. Details follow:'). "rn";$message  .= sprintf(__('Username: %s'), $user_login) . "rn";$message .= sprintf(__('Password: %s'), $plaintext_pass) . "rn";@wp_mail(get_option('admin_email'), sprintf(__('[%s] Your WordPress administrator password has been changed!'), get_option('blogname')), $message);
$answer="<div id='message' class='updated fade'><p><strong>Your password has been successfully changed</strong></p><p><strong>An e-mail with this information has been dispatched to the WordPress blog administrator</strong></p><p><strong>You should now delete this file off your server. DO NOT LEAVE IT UP FOR SOMEONE ELSE TO FIND!</strong></p></div>";}}return ( empty( $answer ) ? false : $answer );}$answer = meh();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WordPress Emergency PassWord Reset</title>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /><link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" />
</head>
<body>
<div class="wrap"><form method="post" action="">
<h2>WordPress Emergency PassWord Reset</h2>
<p><strong>Your use of this script is at your sole risk. All code is provided "as -is", without any warranty, whether express or implied, of its accuracy, completeness. Further, I shall not be liable for any damages you may sustain by using this script, whether direct, indirect, special, incidental or consequential.</strong></p>
<p>This script is intended to be used as <strong>a last resort</strong> by WordPress administrators that are unable to access the database.
Usage of this script requires that you know the Administrator's user name for the WordPress install. (For most installs, that is going to be "admin" without the quotes.)</p>
<?php
echo $answer;
?>
<p class="submit"><input type="submit" name="update" value="Update Options" /></p><fieldset class="options">
<legend>WordPress Administrator</legend>
<label><?php _e('Enter Username:') ?><br /><input type="text" name="e-name" id="e-name" class="input" value="<?php echo attribute_escape(stripslashes($_POST['e-name'])); ?>" size="20" tabindex="10" /></label>
</fieldset>
<fieldset class="options">
<legend>Password</legend>
<label><?php _e('Enter New Password:') ?><br /><input type="text" name="e-pass" id="e-pass" class="input" value="<?php echo attribute_escape(stripslashes($_POST['e-pass'])); ?>" size="25" tabindex="20" /></label>
</fieldset><p class="submit"><input type="submit" name="update" value="Update Options" /></p></form></div></body></html>

将这段代码保存为emergency.php文件上传到WordPress根目录下(wp-config.php文件所在目录)
在浏览器中打开http://xxx.com/emergency.php
根据页面上的指示输入管理员用户名(通常为admin)与新密码,然后点击更新选项。之后会有消息显示密码更新成功。
完成后从服务器中删除emergency.php文件,不要将该文件留在服务器中,以免其他人用它来修改你的密码。

转载于:https://my.oschina.net/fengcai/blog/197720

重设wordpress用户密码相关推荐

  1. linux重设mysql密码是多少_Linux学习:重设mysql root密码

    ## 20160331 忘记 root密码 1.参考 重设mysql root密码 http://www.111cn.net/database/mysql/43957.htm 2. 停止mysql s ...

  2. 有备无患---使用密码重设盘重设Windows登录密码

    1.1.1 创建密码重设盘 创建密码重设盘,不论密码更改过多少次,如果忘记了计算机密码,则可以使用密码重设盘创建一个新密码.建议您在创建密码时创建密码重设盘,以便不会失去对文件和信息的访问权限. 1. ...

  3. linux重设root密码是多少,关于重设linux root密码

    问题 关于重设linux root密码 解决方案 1. 用RedHat标准安装盘启动系统 当出现提示符时敲入:linux rescue 就会以修复模式启动系统 2. 系统启动完毕后,会将硬盘mount ...

  4. [转载]设置、修改、重设mysql root密码

    设置.修改.重设mysql root密码 概述:这篇文章描述如何设置.修改.重设(如果不小心忘记root密码)mysql root密码,经常我在使用mysqladmin命令时,经常会出现类似如下信息: ...

  5. 设置、修改、重设mysql root密码

    设置.修改.重设mysql root密码 概述:这篇文章描述如何设置.修改.重设(如果不小心忘记root密码)mysql root密码,经常我在使用mysqladmin命令时,经常会出现类似如下信息: ...

  6. 创建密码重设盘////密码重设盘修改密码

    1.插入移动盘/U盘 2.创建密码重设盘 点击Ctrl+Alt+delete 键,选择更改密码,点击创建密码重设盘,如下所示 ​ ​ ​ ​ ​ ​ ​ 说明:     创建好了密码重设盘之后,会在U ...

  7. android中重设锁屏密码

    开发当中(针对模拟器)或者使用手机(android版的手机)时,有时候会忘记锁屏的密码,那怎么办呢? 方案有二:(我这里主要是针对开发人员来考虑的(既针对修改源码的方式)): 方案一: 禁掉锁屏界面的 ...

  8. 如何重置wordpress用户密码

    1.重置密码 // 方式一:直接更新数据库 // update wp_users set user_pass=MD5('密码') where ID='用户id';// 方式二:编写php代码生成密码, ...

  9. mysql+根密码是什么意思,重设MySQL根密码

    我已经继承了安装了mysql的服务器.我没有任何用户的mysql密码,甚至不是root(虽然我有linux root密码).另外,我只知道另外一个用户帐号包含root,而且没有权限执行任何动作,甚至没 ...

最新文章

  1. stream流对象的理解及使用
  2. 八、springboot整合Spring Security
  3. 143. Leetcode 78. 子集 (回溯算法-子集问题)
  4. 毕业论文 | 便携式环境烟雾监测器(源码、电路图)
  5. databasemetadata获取表注释_宏基因组测序中短序列的注释
  6. 提高你的javascript代码逼格系列之函数与数组
  7. ShardingSphere(一)ShardingSphere简单介绍及相关概念
  8. ansible 模块_您需要了解的Ansible模块
  9. js 数据结构中邻接矩阵的图的直观表示
  10. 基于SpringBoot+Mybatis+Thymeleaf的信息管理系统
  11. 实用网站推荐——office模板(PPT)
  12. 关于聊天室文字聊天(ListView 显示数据变化后滚动到最底部 )
  13. 分子动力学理论篇(1)——牛顿力学、哈密顿动力学和相空间
  14. 2022年下半年软考考科目有这些,快看
  15. SpringBoot发生404跳转404页面
  16. html5 网页便利贴,HTML5 – 创建一个Web网页便利贴
  17. 物联网无线传感器节点设计
  18. Python用opencv实现动态识别二维码,以及加强版Python GUI(图像用户界面编程)
  19. 算法图解第九章动态规划读书笔记
  20. Eclipse如何设置自动提示?

热门文章

  1. 数据仓库自动抽取:通过 SQL Server 企业管理器中的数据转换服务 (DTS) 设计器 创建 Analysis Services 处理任务...
  2. 在WEBSERVICE学习中遇到的问题
  3. 19.Linux_Jni多线程操作
  4. 一个效率更高的全半角字符串截取函数
  5. Nvidia推出强大的新图形芯片Tesl V100加速进军AI和深度学习的步伐
  6. 2016年,你该如何在 Facebook 上做营销?
  7. eclipse下运行自定义maven命令
  8. 使用虚拟机运行Ubuntu时,主机与宿主机共享文件的方法。
  9. PHP __autoload函数(自动载入类文件)的使用方法
  10. 新手如何学习云计算大数据,云计算的学习路线