一直用roboform自動生成的密碼管理網站,自己很少去記住密碼,今天說來手賤。。。登錄後台的時候自己手動輸入了下密碼,問題就出在我輸入的密碼是自己平時用的常規密碼,roboform跳出來我又手賤的點擊了保存,那操作堪比WCG...還沒等我自己反應過來就已經把原來的密碼覆蓋了。。。
, J, H/ f+ p9 J另外我用的是無敵小子這個教程安裝的http://www.luosuo.net/old/forum.php?mod=viewthread&tid=102698&fromuid=65480
0 _/ i: r4 u x2 I0 [一鍵安裝WP那叫一個方便,問題來了,因為一鍵安裝我連自己的mysql帳號和密碼都不知道,更不用說進phpmyadmin修改什麼的,國內搜索了下各種解決方案,都是老掉牙了,都失效了
2 \4 O. ~% D2 J3 T |
- q4 o% p" O2 M; h: a廢話結束還是直接上正題把,方法不再多能用就行!
* `: M$ e9 |) k0 }- T6 [& u在桌面新建一個emergency.php的文件,複製下面代碼進去保存,把emergency.php的文件上傳到你的wordpress根目錄,然後訪問http://你的域名/emergency.php,重新設置密碼即可- <?php
0 K: ^6 j8 Q: @/ t - /*& M) u6 o5 g2 J+ ?5 h
- This program is free software; you can redistribute it and/or modify. t; Q: P& [. L
- it under the terms of the GNU General Public License as published by
" v% b N7 T. a# L- N6 c - the Free Software Foundation; either version 2 of the License, or8 P- H4 A6 i( C5 a+ I! x
- (at your option) any later version.6 ~# }$ ?# U0 g1 s# Z: j; O! a
5 @8 O1 F6 }3 y- This program is distributed in the hope that it will be useful,
5 S5 X" O+ }" ^' [ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ {5 j" x- r6 w$ t# n+ P5 N" G - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the$ m+ x- ?. Z# y
- GNU General Public License for more details.
) K* L- C: `2 }1 H& v* h7 v9 e
7 y9 P1 i. f6 K+ f. M& k- You should have received a copy of the GNU General Public License
0 h# W- b3 s6 i4 R1 c2 H7 x - along with this program; if not, write to the Free Software
# o) z. n: c2 N: l$ B - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA5 S8 M4 c/ S( q) ?3 ]" V8 t( b
- */
0 x' C0 U/ z9 s( M* P3 [# ~+ l - . S/ s$ S- ?9 A% i
- require './wp-blog-header.php';% P! A# C. D1 ?- D, f6 C
}& c6 C; N9 `# |2 z" `" l9 P) x- function meh() {
8 N, |8 X0 D6 v/ w0 N) O - global $wpdb;& K' A1 _9 C7 t( t% t }$ o
! N: [* z1 h$ P* N- if ( isset( $_POST['update'] ) ) {: v: F( F: h7 K0 {* P
- $user_login = ( empty( $_POST['e-name'] ) ? '' : sanitize_user( $_POST['e-name'] ) );
& f- u) c! A- Q# J; H7 R - $user_pass = ( empty( $_POST[ 'e-pass' ] ) ? '' : $_POST['e-pass'] );
7 o" |9 |$ k+ B: Q# J - $answer = ( empty( $user_login ) ? '<div id="message" class="updated fade"><p><strong>The user name field is empty.</strong></p></div>' : '' );
+ f8 z. f; u, p+ b$ w4 L: a, R - $answer .= ( empty( $user_pass ) ? '<div id="message" class="updated fade"><p><strong>The password field is empty.</strong></p></div>' : '' );
* L# o0 \9 M9 M0 k - if ( $user_login != $wpdb->get_var( "SELECT user_login FROM $wpdb->users WHERE ID = '1' LIMIT 1" ) ) {
4 Y* m7 E& P# X! g, B - $answer .="<div id='message' class='updated fade'><p><strong>That is not the correct administrator username.</strong></p></div>";
* r' z7 W- R: M - }- B+ ]/ o& a( @8 Y: {0 S" v
- if ( empty( $answer ) ) {
& z# O) w! W- O6 U- f b& s" F - $wpdb->query( "UPDATE $wpdb->users SET user_pass = MD5('$user_pass'), user_activation_key = '' WHERE user_login = '$user_login'" );4 o6 {2 C# C* J/ O& `
- $plaintext_pass = $user_pass;: C% ?4 P2 [" Y9 ]# s. t! _
- $message = __( 'Someone, hopefully you, has reset the Administrator password for your WordPress blog. Details follow:' ). "\r\n";
1 \# x5 ~& K* c7 J0 U' N - $message .= sprintf( __( 'Username: %s' ), $user_login ) . "\r\n";8 X2 S5 G: l" g0 |* r
- $message .= sprintf( __( 'Password: %s' ), $plaintext_pass ) . "\r\n";5 M+ o7 o# p/ u6 c
- @wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Your WordPress administrator password has been changed!' ), get_option( 'blogname' ) ), $message );: t7 ~* q+ Q- `4 ]4 P0 c% Q, E% J
- $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>";
# G8 X2 n4 H. u3 G - }# C! w0 Z4 W7 E4 ?+ y
- }6 Q' m# V2 G" c, Q
- R* u7 i+ b u# l- k- return empty( $answer ) ? false : $answer;) c! d: u4 I9 }$ `7 k
- }2 U. j; R3 F- E
- + X3 Z3 n: _+ I
- $answer = meh();
$ Y; T G# G4 @& c N# R7 f - ?>
, J9 y9 {; X$ x8 i6 w: ^* K8 O - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
9 |( W" e6 {6 D3 d; m3 u/ q - <html xmlns="http://www.w3.org/1999/xhtml">
8 {/ R) g& k1 v( K0 _7 @: ~: f - <head>
) s x9 l" U' u, l1 @ - <title>WordPress Emergency PassWord Reset</title>& `4 ?0 D6 V6 M! ]1 a
- <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
9 {+ P z3 l- M- o, O' J - <link rel="stylesheet" href="<?php bloginfo( 'wpurl' ); ?>/wp-admin/wp-admin.css?version=<?php bloginfo( 'version' ); ?>" type="text/css" />
% e* X* M, k% L' I- P F% \6 i5 B# u - </head>
c$ W# h& s+ M4 I5 ] - <body>
+ F2 Y. p) _9 S1 |9 }! A, N - <div class="wrap">/ Y9 I) z( h) `( M7 G0 ]
- <form method="post" action="">
0 q+ O: l" L- X0 Y2 t5 [ - <h2>WordPress Emergency PassWord Reset</h2>
( `+ K) s& z" e# y - <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>
1 z, d) Z5 ]+ S( e - <p>This script is intended to be used as <strong>a last resort</strong> by WordPress administrators that are unable to access the database.0 x0 U, h# u; M6 I# \
- 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>' U1 k$ p% g: V4 @( T; v, M
- <?php
: a4 ^. g$ i) U6 X& K* [ - echo $answer;3 E& _- Q9 h; T, V" z8 ~1 k
- ?>* B' e# I+ T) M6 k; L! U; a2 l
- <p class="submit"><input type="submit" name="update" value="Update Options" /></p>
# P( Z# u* S4 C) o
. W- y9 }( X0 h4 _+ e; H- <fieldset class="options">
. A3 n) ~( G X5 ~- a; _ - <legend>WordPress Administrator</legend>6 @& n r1 Z# ^+ T" ^
- <label><?php _e( 'Enter Username:' ) ?>
: I9 ~ `, H, d1 l) K% P - 0 ?9 h9 ?0 ^/ g
- <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>
4 R3 F/ Z6 _- ^$ G - </fieldset>
. d0 K; r: N; r* v5 T7 n+ e. E - <fieldset class="options">
& A* y- A& C. j! v - <legend>Password</legend>
! S0 P8 G: l" X1 W - <label><?php _e( 'Enter New Password:' ) ?>
$ u, A8 L* z! `/ X7 O4 E: V - 4 h1 R; O+ J- k- C2 j
- <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>
2 {0 ^, o3 M7 G" N8 @. m - </fieldset>; ~* t" s7 ~: O5 N& D
: q# C. M* R8 |+ w$ o- <p class="submit"><input type="submit" name="update" value="Update Options" /></p>2 j. h: F+ O1 ~2 r
- </form>
$ G X9 X u' o+ l. P) y$ w4 B( F - </div>7 b0 I2 }/ F2 Q! N- M- G1 N3 n1 v
- </body>5 i7 u, u& X# f
- </html>
9 o0 b- c( k; J+ ^
複製代碼
wordpress重置密码
* X; a) G$ S7 M; s6 T6 z- @5 x! m5 x" ]6 n" R! j
最後重置完後別忘記刪除emergency.php文件。
8 a$ H$ K+ p$ L0 G方法來自老外,lion親測可用,有備無患大家收藏著,感覺好別忘記加分哦!!!
4 h9 S* T8 A" f$ q6 H( [4 ?* z. V. ^4 W( a: _
; O$ _ T6 u% ~$ q/ r# e3 ^7 b# i5 m; a
6 K7 z4 d8 s5 ], F* b% Z5 R G
) Q: _4 L! T2 s |