一直用roboform自動生成的密碼管理網站,自己很少去記住密碼,今天說來手賤。。。登錄後台的時候自己手動輸入了下密碼,問題就出在我輸入的密碼是自己平時用的常規密碼,roboform跳出來我又手賤的點擊了保存,那操作堪比WCG...還沒等我自己反應過來就已經把原來的密碼覆蓋了。。。& U4 K$ @# | b" t. }7 ]
另外我用的是無敵小子這個教程安裝的http://www.luosuo.net/old/forum.php?mod=viewthread&tid=102698&fromuid=65480 p5 X& H5 f9 d" A- ~' s6 N
一鍵安裝WP那叫一個方便,問題來了,因為一鍵安裝我連自己的mysql帳號和密碼都不知道,更不用說進phpmyadmin修改什麼的,國內搜索了下各種解決方案,都是老掉牙了,都失效了
0 b& z! d; }& a% t5 D% N- E
; _* N6 q5 y! y$ s. i廢話結束還是直接上正題把,方法不再多能用就行!
3 n8 V6 l- `8 m* l# \在桌面新建一個emergency.php的文件,複製下面代碼進去保存,把emergency.php的文件上傳到你的wordpress根目錄,然後訪問http://你的域名/emergency.php,重新設置密碼即可- <?php) ?( U9 W6 J. P2 Q$ @6 a
- /*
0 q! G; n3 U0 B, h. l - This program is free software; you can redistribute it and/or modify2 G! U" I* w; f* o T
- it under the terms of the GNU General Public License as published by
3 x3 s9 o2 V' }- } - the Free Software Foundation; either version 2 of the License, or
- z7 @8 S8 O* p/ o7 l - (at your option) any later version.
: S/ F0 b& s4 i7 _0 C - ' v* V7 O5 \" n( G& s
- This program is distributed in the hope that it will be useful,
5 D1 c8 g/ K$ ^* r. M9 n$ H- i - but WITHOUT ANY WARRANTY; without even the implied warranty of
5 p; y) o5 H) X5 z, F/ t - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9 `' f& U) M& _
- GNU General Public License for more details.8 _9 A& U) B% ]0 a; `$ O
- 0 P |9 z! a. [
- You should have received a copy of the GNU General Public License* ^. \2 H; H) l6 F" F
- along with this program; if not, write to the Free Software3 ^ J; v1 T/ X" o8 N
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA% _( z0 m" }' _ v
- */7 v* w+ f0 p5 C; g2 A
- * w9 _; N- ?5 A$ |% b B
- require './wp-blog-header.php';
" A. L' F& T5 Y$ r* c# l% V - . k' n* `* F P6 x' S/ f2 e
- function meh() {
' d; _: a+ h2 w) B6 T, { - global $wpdb;+ _6 Y* }5 q6 P8 E7 d
- 4 B* C; B6 I) J- p* d7 ^0 Z3 o
- if ( isset( $_POST['update'] ) ) {
* v" d0 E4 N) K! J% C1 A - $user_login = ( empty( $_POST['e-name'] ) ? '' : sanitize_user( $_POST['e-name'] ) );
% x2 [2 `5 G' q/ |" q6 ?0 ^8 F2 T - $user_pass = ( empty( $_POST[ 'e-pass' ] ) ? '' : $_POST['e-pass'] );( d3 o: t1 x7 R3 q$ k
- $answer = ( empty( $user_login ) ? '<div id="message" class="updated fade"><p><strong>The user name field is empty.</strong></p></div>' : '' );
8 P2 B6 b1 r) \ k3 w+ N: e d - $answer .= ( empty( $user_pass ) ? '<div id="message" class="updated fade"><p><strong>The password field is empty.</strong></p></div>' : '' );
! h' B8 o7 |% p+ [2 l" G3 W - if ( $user_login != $wpdb->get_var( "SELECT user_login FROM $wpdb->users WHERE ID = '1' LIMIT 1" ) ) {9 F0 j- Z k. C% {. L" e
- $answer .="<div id='message' class='updated fade'><p><strong>That is not the correct administrator username.</strong></p></div>";0 @% m2 L* f4 l0 o6 m4 C
- } f3 b" ?7 C" y# @( J: C* V' {' s
- if ( empty( $answer ) ) {2 ^& X) p; B' I' W0 f
- $wpdb->query( "UPDATE $wpdb->users SET user_pass = MD5('$user_pass'), user_activation_key = '' WHERE user_login = '$user_login'" );
6 a0 h) `/ H* o. O6 A( P - $plaintext_pass = $user_pass;+ Y$ M v4 O1 f, G
- $message = __( 'Someone, hopefully you, has reset the Administrator password for your WordPress blog. Details follow:' ). "\r\n";0 K# I$ f, e4 M2 ~+ @
- $message .= sprintf( __( 'Username: %s' ), $user_login ) . "\r\n";
7 h4 \: d1 I" Z) e" L. U2 I - $message .= sprintf( __( 'Password: %s' ), $plaintext_pass ) . "\r\n";
' W$ G5 I0 q/ H - @wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Your WordPress administrator password has been changed!' ), get_option( 'blogname' ) ), $message );
; ?! p( W; M, t - $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>";3 P: t) ]. o1 A3 O" n7 h$ [
- }
( N( z; F) _+ }$ a - }
, j4 O* A7 ^. e f, R' V) s
5 a& d8 k7 @" E- return empty( $answer ) ? false : $answer;4 V3 X+ q$ ~; ^/ Z- i
- }" ~- X0 }1 r1 C) Y
, z8 `' _- V; E* `. O- $answer = meh();
6 {, u5 g1 ~* ]' {2 d - ?>
* Y/ ]% a; O+ M6 C$ I - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- w. B$ k0 ?" N; @1 `# ~ - <html xmlns="http://www.w3.org/1999/xhtml">
! T* M( {8 ^' k B - <head>
+ c* Q2 U R! h* A6 ^ - <title>WordPress Emergency PassWord Reset</title>0 a% M2 K3 `2 q
- <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
# d' P4 q! ^# ]/ w, s* N5 h - <link rel="stylesheet" href="<?php bloginfo( 'wpurl' ); ?>/wp-admin/wp-admin.css?version=<?php bloginfo( 'version' ); ?>" type="text/css" />' C" z. V% e* I& u
- </head>
# o! q- g% J, i/ p" s - <body>
6 r! _9 M4 P7 g ^$ c7 o; K - <div class="wrap">; B- U8 f+ X; f" \4 L
- <form method="post" action="">
( d0 Z+ q6 ? z9 D5 O' i4 s1 _7 |0 g - <h2>WordPress Emergency PassWord Reset</h2>
* T2 \* P% _" b" Q: z. x# I - <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>
: K! f! G4 L3 \/ [, r$ I; Q- R - <p>This script is intended to be used as <strong>a last resort</strong> by WordPress administrators that are unable to access the database.
$ m9 g8 o5 G& p- y) q - 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>3 v d: n: V! \5 ~4 Q( {3 K2 U- @
- <?php$ |" V: r; z, k, X0 l3 J# g0 W/ O
- echo $answer;
, z- V, d6 i; A/ ^ - ?>1 k6 A" R5 }4 S! V& P/ _% q3 p
- <p class="submit"><input type="submit" name="update" value="Update Options" /></p>7 @: W c( Z8 m
- + x& R% n; M+ h% y3 F. Q8 }
- <fieldset class="options">
B/ C* x& [; @5 j0 G5 { - <legend>WordPress Administrator</legend>
0 ]/ S; T, Y- X+ ]5 v, ? - <label><?php _e( 'Enter Username:' ) ?>
1 q/ X x$ b( b4 ]& j. P5 I4 ]" X - ; o9 ^8 u% d3 l
- <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>
% P8 t6 j& f* Z" W" A - </fieldset>( P0 }- i7 L6 d; Y6 [0 U \9 V
- <fieldset class="options">
: W0 {- g. }- C- ?% D l8 K7 C$ M - <legend>Password</legend>
1 L) n1 [' x5 b& F% ~6 V8 }9 B' { - <label><?php _e( 'Enter New Password:' ) ?>1 d% l. m+ P' Z
: _4 e7 e& B. n& @0 ~- b- k- <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>4 C* n4 t Q$ {4 R& X
- </fieldset>
6 k' E; A0 o/ h8 ^7 g$ x
. i1 x2 i9 A2 A$ d5 S- { M, a- <p class="submit"><input type="submit" name="update" value="Update Options" /></p>( m% |8 n0 J7 a# V/ A: c
- </form>, D2 K) m, {; \* }& Y8 }& T
- </div>
) ~# ~2 e- u- N* {: ? - </body>* ^& J! y/ a F7 i- d, I6 f/ C
- </html>
' W m9 S0 U4 c" D6 _" C
複製代碼
wordpress重置密码
1 p1 \! z( G- k- [* m0 F9 L( V) K. f$ k
最後重置完後別忘記刪除emergency.php文件。0 g1 W) a* e5 S! b
方法來自老外,lion親測可用,有備無患大家收藏著,感覺好別忘記加分哦!!!2 p) o: Z b0 s% C/ J& k
9 Q, B: \0 ?( B5 X, R2 c' H D( n: A
0 Y. u. `. z U) q7 y/ d1 ~; f, z
# y8 `- n- Z9 o2 k# U
|