此方法适用于无法登录后台数据库,不会操作root命令行,PHPmyadmin无法打开。
在你的后台根目录下新建pwdchange.php文章源自原紫番博客-https://www.yuanzifan.com/54350.html
写入如下代码:文章源自原紫番博客-https://www.yuanzifan.com/54350.html
- <?php
- include("wp-config.php");
- if (empty($_POST['resetpwd'])) {
- ?>
- <form method="post">
- 输入新密码:
- <input name="resetpwd" type="password" />
- <input type="submit" value="提交"/>
- </form>
- <?php
- }else{
- $sql = "UPDATE ".$wpdb->users." SET user_pass = '".md5($_POST['resetpwd'])."' WHERE User_login = 'admin'";
- $link = $wpdb->query($sql);
- wp_redirect('wp-login.php');
- exit();
- }
- ?>
输入你的域名/pwdchange.php。输入新的密码,即可重设后台登录密码。文章源自原紫番博客-https://www.yuanzifan.com/54350.html
不要纠结下面的配图,我觉得海绵宝宝会给PHP力量。文章源自原紫番博客-https://www.yuanzifan.com/54350.html
文章源自原紫番博客-https://www.yuanzifan.com/54350.html
文章源自原紫番博客-https://www.yuanzifan.com/54350.html
站长微信
扫码添加(注明来意)

Yuanzifan99
原梓番博客公众号
博客内容精选

原梓番博客
评论