一直用roboform自動生成的密碼管理網站,自己很少去記住密碼,今天說來手賤。。。登錄後台的時候自己手動輸入了下密碼,問題就出在我輸入的密碼是自己平時用的常規密碼,roboform跳出來我又手賤的點擊了保存,那操作堪比WCG...還沒等我自己反應過來就已經把原來的密碼覆蓋了。。。
( e+ o2 K W% k" V# i3 s Q另外我用的是無敵小子這個教程安裝的http://www.luosuo.net/old/forum.php?mod=viewthread&tid=102698&fromuid=654800 y5 a; h* w( w: [+ \ Q
一鍵安裝WP那叫一個方便,問題來了,因為一鍵安裝我連自己的mysql帳號和密碼都不知道,更不用說進phpmyadmin修改什麼的,國內搜索了下各種解決方案,都是老掉牙了,都失效了4 i" R! @) ]+ U6 ?
, x4 G; V9 Z7 {6 c廢話結束還是直接上正題把,方法不再多能用就行!
2 F) p7 B7 c2 ^. G! O在桌面新建一個emergency.php的文件,複製下面代碼進去保存,把emergency.php的文件上傳到你的wordpress根目錄,然後訪問http://你的域名/emergency.php,重新設置密碼即可- <?php
' B. V4 h* r' C( { l - /*
' y- g+ L" L# C9 P - This program is free software; you can redistribute it and/or modify) U5 ?! T& R1 M) M7 E% Y$ m4 e
- it under the terms of the GNU General Public License as published by8 l7 v& N, W5 a1 y; J
- the Free Software Foundation; either version 2 of the License, or
" ?! q, b$ ?1 k1 p7 I - (at your option) any later version.2 { X' g6 p/ v
- - f2 j5 v) G1 S4 f7 Z1 D
- This program is distributed in the hope that it will be useful,8 q, c; b2 ^6 d, T6 [% r$ @( Q3 {$ b# K
- but WITHOUT ANY WARRANTY; without even the implied warranty of
0 N' ^1 z2 h! L! L f - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
( C% n* A, I7 V b7 d( z - GNU General Public License for more details.
' K$ b$ d3 ?7 X* p6 F' G% o
; B$ k2 s, P; ]' S% @; X% Q! H- You should have received a copy of the GNU General Public License& N+ b& G8 `' S# l- {
- along with this program; if not, write to the Free Software; [4 G: u$ u; Y5 D; b
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA: _+ x9 c; c8 ]" @, l
- */
" l: ]4 s: b4 e0 @6 t - 3 R! T; x m- ^1 a, h
- require './wp-blog-header.php';, v* B3 ^, N% F; k% ?: C5 ~1 f. j
. T$ Q; B. a' p$ A+ ^- function meh() {0 U5 ]. V0 L/ n) b: w
- global $wpdb;
) N1 S; s/ @: B' U) o- E - , V. ^% B/ X |
- if ( isset( $_POST['update'] ) ) {
. G) L9 o: x7 b# y/ B - $user_login = ( empty( $_POST['e-name'] ) ? '' : sanitize_user( $_POST['e-name'] ) );* ], a9 e3 F4 F' T- {1 B5 [7 Z" L
- $user_pass = ( empty( $_POST[ 'e-pass' ] ) ? '' : $_POST['e-pass'] );
2 g1 ^- ^% u0 Y' B% j - $answer = ( empty( $user_login ) ? '<div id="message" class="updated fade"><p><strong>The user name field is empty.</strong></p></div>' : '' );
" k5 r; w Q: n - $answer .= ( empty( $user_pass ) ? '<div id="message" class="updated fade"><p><strong>The password field is empty.</strong></p></div>' : '' );* }* G! \' s) _: @! l
- if ( $user_login != $wpdb->get_var( "SELECT user_login FROM $wpdb->users WHERE ID = '1' LIMIT 1" ) ) {0 T6 L& ~; h6 _5 Z6 f4 c# B
- $answer .="<div id='message' class='updated fade'><p><strong>That is not the correct administrator username.</strong></p></div>";
. U- N9 C6 _/ z6 T) A2 g) } - }& _+ C: `1 ?, T/ `8 I: T% y0 t
- if ( empty( $answer ) ) {
6 T" \7 }4 G5 w0 B - $wpdb->query( "UPDATE $wpdb->users SET user_pass = MD5('$user_pass'), user_activation_key = '' WHERE user_login = '$user_login'" );% n( Y4 q! U; G8 [& ~
- $plaintext_pass = $user_pass;
+ U+ x7 b, d9 o5 `4 b - $message = __( 'Someone, hopefully you, has reset the Administrator password for your WordPress blog. Details follow:' ). "\r\n";
# c3 V. c! D" y7 V# U5 w - $message .= sprintf( __( 'Username: %s' ), $user_login ) . "\r\n";. o7 I5 g7 @/ N* J+ m
- $message .= sprintf( __( 'Password: %s' ), $plaintext_pass ) . "\r\n";
' y _1 ~# o& I1 D& R# e - @wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Your WordPress administrator password has been changed!' ), get_option( 'blogname' ) ), $message );
" |3 H$ U* F! ^; n) J. p - $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>";
- q8 ~3 M/ _* p( y% s - }. R; G) j9 i! L8 b7 n. a( B
- }
5 P* J5 K& r2 S# n( H/ O& } - 9 I. `# D3 e/ m& V) Z' e
- return empty( $answer ) ? false : $answer;9 p! W" l# {5 T, {+ _: h7 ]
- }
4 p/ n" |; ?4 P: a
! _; @: l, T, ?# J ?+ D- $answer = meh();
1 S( Y. f% n0 z- l5 D- E - ?>; b6 C8 d- Z/ T" \8 x3 ?
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
9 X8 e" M- X B - <html xmlns="http://www.w3.org/1999/xhtml">
# F `2 o) v) j. U - <head>
- s" |) w4 C* R% Y3 E. [ - <title>WordPress Emergency PassWord Reset</title>
+ Y/ p: @$ Q& o; {2 {0 h3 H - <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />+ m1 W8 M) |8 E3 n7 v. E' E
- <link rel="stylesheet" href="<?php bloginfo( 'wpurl' ); ?>/wp-admin/wp-admin.css?version=<?php bloginfo( 'version' ); ?>" type="text/css" />
! R2 U- \/ P( [/ A, l, c5 C) @( p - </head>
, _7 R1 \' b% Z4 j* D/ s' a% j2 i3 | - <body>5 G S3 L! P/ {
- <div class="wrap">9 \5 A- H7 J4 _# b k, E2 a
- <form method="post" action="">
\0 X. V! g5 t/ b - <h2>WordPress Emergency PassWord Reset</h2>% \, M9 w/ S8 L' V W; X+ X
- <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>" h( V1 g, t& v: L* g3 z0 k0 [
- <p>This script is intended to be used as <strong>a last resort</strong> by WordPress administrators that are unable to access the database.8 W6 [: f% ]0 q. ?( G$ h+ o
- 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>
: E$ @' b+ T- h: v$ P4 _8 _ - <?php
* Q2 d/ {/ W& j9 N - echo $answer;
6 e3 }7 b, c& f @; P - ?>
% Y1 J4 r1 q1 U4 w4 t( ] \* ~: C( ] - <p class="submit"><input type="submit" name="update" value="Update Options" /></p>$ `9 E2 h; O y# F
3 e5 C, {( z; S; [- <fieldset class="options">
9 P5 X- m/ G' a4 s6 e L - <legend>WordPress Administrator</legend>
9 f6 {4 A, N* F" J0 p; Q - <label><?php _e( 'Enter Username:' ) ?>
( i. y7 D# K, m @6 v) A
' U' a2 ]% d: Q9 r/ k) 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>) q4 ?3 ?" a- f* H+ x
- </fieldset>, R: h0 ], b' J6 `- q
- <fieldset class="options">: n5 A$ D0 j" L3 a6 b% b
- <legend>Password</legend>
+ H, d }" m* S, O' @- `2 M( [1 C8 ~ - <label><?php _e( 'Enter New Password:' ) ?>& C4 W/ R( W/ }1 B
7 N0 K1 r7 n! K, B/ j, D, s* l: p- <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>( F# _7 `- ~( U" v
- </fieldset>+ G+ B9 e: ? t! f$ k; X4 [% w
" e' d& O) h) W$ D% z- <p class="submit"><input type="submit" name="update" value="Update Options" /></p>
8 N. c4 {* m L. j% |, f - </form>
% M1 ~9 \6 ^: u% \1 Y0 ^; y - </div>0 \/ |8 e2 r3 U$ I. i! ~5 ?5 n
- </body>' I* e {' J( a$ ]
- </html>; G0 S- u2 K. W0 F) G
複製代碼
wordpress重置密码
5 d5 U% F# A4 K: `8 a
4 G @' J$ P% b- v
最後重置完後別忘記刪除emergency.php文件。
2 w; |: G& x3 ?5 b方法來自老外,lion親測可用,有備無患大家收藏著,感覺好別忘記加分哦!!!
* I! @) q- O: w$ a( H1 i
`. ?. G, I( ~1 o# f# ^/ ]' Y/ e7 h
" q* _# j/ c4 _: I; j+ f$ {! N* N
. [# x; b0 u! G7 M0 e
+ M" C# m9 u; @/ }, e# U4 _ |