This is a translated page. The original can be found here: http://iwebdevel.com/2009/06/08/wordpress-easily-reset-your-account-password-using-mysql-and-php/
UPDATES VIA RSS | Email Atnaujinimai Via RSS | E-mail Get updates via feedburner Get updates via twitter
Home / Coding / MySQL / PHP / Wordpress: Easily Reset Your… Pagrindinis / Kodai / MySQL / PHP / WordPress: lengvai pakeisti savo ...

Wordpress: Easily Reset Your Account Password Using MySQL and PHP WordPress: lengvai pakeisti slaptažodį sąskaitos naudojant MySQL ir PHP

Posted on 08. Posted on 08. Jun, 2009 by Dragos in Coding , MySQL , PHP Birželis, 2009 Dragos ir kodavimo, MySQL, PHP,

I've just forgot my admin password on my local testing blog, and what is worse – my local machine is not configured to send external email. Aš tiesiog užmiršau administratoriaus slaptažodį į mano vietos bandymai dienoraštį, o kas dar blogiau - mano vietiniame kompiuteryje nėra sukonfigūruotas išorinės Siųsti el. Oh yeah, got to reinstall wordpress again, what a pity. Oh yeah, turite įdiegti WordPress kartą, ką gaila. No way! No way! There are two ways of resetting your password using two easy methods. Yra du būdai, naudojant slaptažodžio dviem paprastais būdais. You'll need basic knowledge of PHP or CPanel+PHPMyAdmin. Jums reikės elementarios žinios apie PHP, cPanel + PHPMyAdmin.

I Method: CPanel+PHPMyAdmin I metodas: cPanel + PHPMyAdmin

For this method, it is necessary that your host have CPanel and PHPMyAdmin installed. Už šį metodą, būtina, kad jūsų įsikurti cPanel ir PHPMyAdmin įdiegta. If your host doesn't have these pieces of software, but something similar to these, you can follow this tutorial and apply these steps to your situation. Jei jūsų buvimo nėra šios įrangos dalys, bet kažkas panašaus į šiuos, jūs galite sekti šio vadovo ir taikyti šiuos veiksmus, jūsų padėtį.

First we'll need to open the PHPMyAdmin page. Pirmiausia mums reikės atidaryti PHPMyAdmin puslapyje. From the CPanel root page, launch PHPMyAdmin. Nuo cPanel root puslapį, pradėti PHPMyAdmin. The icon of PHPMyAdmin should look similar to the one emphasized in the screenshot below. Iš PHPMyAdmin piktograma turėtų atrodyti panašiai į vieną pabrėžiama ekrano apačioje.

PHPMyAdmin

PHPMyAdmin PHPMyAdmin

Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. Patekę į pagrindinį puslapį PHPMyAdmin turėtumėte prisiminti, kas bazėje pildėte diegiant wordpress. If you don't remember, don't get angry. Jei neprisimenate, don't get angry. Go to your root folder where wordpress is installed and download & open the file wp-config.php with a simple text editor like Notepad/GEdit. Eikite į savo namų katalogą, kur wordpress įdiegta ir parsisiųsti ir atidarykite failą wp-config.php su paprastų teksto redaktorių, pavyzdžiui Notepad / gedit. You'll need to find this line: Jums reikia surasti šios eilutės:

 define('DB_NAME', 'ABCD'); define ( 'db_name "," abcd "); 

Note that ABCD (without the single quotes around it) is the name of the database that wordpress is installed in. Atkreipkite dėmesį, kad ABCD (be kabučių aplink jį) yra duomenų bazės pavadinimą, kad WordPress yra įdiegta in

Back on the PHPMyAdmin page, click on the link of your database name. Atgal į PHPMyAdmin puslapį, paspauskite ant savo duomenų bazės pavadinimą nuorodą. In my case it was _iwebdevel . Mano atveju tai buvo _iwebdevel.

Select your database

Select your database Pasirinkite duomenų bazę

Now you'll see another PHPMyAdmin page, but this time you'll be presented all your tables contained in the ABCD database. Dabar jūs pamatysite kitą PHPMyAdmin puslapyje, tačiau šį kartą Jums bus pateiktas visas jūsų pateiktas lenteles ABCD duomenų bazėje. We need to select the table users . Mums reikia pasirinkti lentelės vartotojams. You won't see the exact name users of this table, but a name in this format xx_users , where xx_ is the prefix of your wordpress table names. Jūs nematysite kituose vartotojai šioje lentelėje, tačiau šiuo formatu xx_users, kur xx_ yra jūsų WordPress pavadinimų lentelių prefiksas pavadinimas. Click on the link of your users table ( xx_users ). Paspauskite ant jūsų vartotojai lentelė (xx_users) link. In my case, as in most cases it's wp_users : Mano atveju, nes daugeliu atvejų tai wp_users:

Select the users table

Select the users table Pasirinkite vartotojai lentelė

Now click on browse to see the rows contained in table xx_users . Dabar paspauskite Žmonės pamatyti eilučių lentelės xx_users.

Click on browse

Click on browse Spustelėkite Naršyti

Now look for the username you want to reset the password. Dabar atrodo, kad vardą, kurį norite atstatyti slaptažodį. In my case I want to reset password for admin. Now click on the edit button. Mano atveju aš noriu slaptažodžio administratoriui. Dabar paspauskite mygtuką Redaguoti.

Edit user's details

Edit user's details Redaguoti vartotojo duomenis

Now you'll need to generate an MD5 hash of the new password you would like to set. Dabar jums reikės sukurti MD5 hash naują slaptažodį, kurį jūs norite nustatyti. Go to http://seoanalytic.com/tools/md5_encryptor/ and enter your preferred password. Grįžti į http://seoanalytic.com/tools/md5_encryptor/ ir įveskite savo pasirinktą slaptažodį. After you enter your new password, click on the Encrypt! button. Po to įveskite naują slaptažodį, spauskite šifravimas! Mygtuką.

Encrypt your password

Encrypt your password Koduoti slaptažodį

After you've encrypted your password, select and copy the newly MD5 generated hash code. Baigê saugiame savo slaptažodį, pasirinkite ir nukopijuokite naujai MD5 generuoja maišos kodą.

Select and copy the MD5 hash

Select and copy the MD5 hash Pažymėkite ir nukopijuokite MD5 hash

Now return to your PHPMyAdmin page and paste your MD5 hash from the clipboard to the input field as shown in the image below: Dabar grįžkite į savo PHPMyAdmin puslapį ir įklijuokite savo MD5 hash iš Mainų į įvedimo lauką, kaip parodyta paveikslėlyje žemiau:

Paste MD5 hash in the specified input field

Paste MD5 hash in the specified input field Nukopijuokite MD5 hash į nurodytą laukai

Finally click on Go button to save your new password. Galiausiai spauskite mygtuką Eiti išsaugoti naują slaptažodį.

Save new password

Save new password Įrašyti naują slaptažodį

II Method: PHP II metodas: PHP

In my opinion the second method is much faster and simpler. Mano nuomone, antrasis metodas yra žymiai greitesnis ir paprastesnis. In this method you'll just have to upload a PHP file to your host and access it with a browser. Taikant šį metodą, jums tereikia nusiųsti PHP failą į savo šeimininke ir jos ryšys su naršykle. But we'll talk about it a little bit later. Bet mes kalbame apie tai truputį vėliau.

So here's the piece of PHP code I've came up with to help you reset your wordpress account password. Taigi čia PHP kodas I've sugalvojo, kad padėtų jums nustatyti savo WordPress sąskaitos slaptažodį gabalas.

	$newPassword='NEW_PASSWORD_GOES_HERE'; //put your new password between the single quotes $username='admin'; //put the login username you'd like to change the password to @include_once('./wp-config.php'); //get some details from your wordpress installation global $table_prefix; $conxb=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD); //establish connection to your database mysql_select_db(DB_NAME,$conxb); $query='update `'.$table_prefix.'users` set `user_pass`=\''.mysql_real_escape_string(md5($newPassword)).'\' where `user_login`=\''.mysql_real_escape_string($username).'\' limit 1'; $mQuery=mysql_query($query,$conxb); //set new password echo $mQuery?'Successfully set new password. $ Newpassword = 'NEW_PASSWORD_GOES_HERE'; / / įdėti naują slaptažodį tarp vienos citatos $ username = 'Administratorius'; / / įdėti prisijungimo vardą, kurį norite pakeisti slaptažodį, @ include_once ( ". / wp-config.php '); / / kažkiek iš jūsų WordPress diegimo global $ table_prefix detales; $ conxb = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) / / užmegzti ryšį su duomenų baze mysql_select_db (db_name, $ conxb); $ query = "update" " . $ table_prefix. "naudotojai" rinkinys "user_pass` = \''. mysql_real_escape_string (md5 ($ Newpassword)). "\", kur "user_login` = \''. mysql_real_escape_string ($ username). "\ 'limitu 1"; $ mQuery = mysql_query ($ query, $ conxb) / / set naują slaptažodį echo $ mQuery? "sėkmingai nustatyti naują slaptažodį. New password: '.$newPassword:'There was an error. Naujas slaptažodis: ". $ Newpassword:" Įvyko klaida. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message mysql_close($conxb); Klaida: '. Mysql_error () / / jei rezultatas yra nesėkmingas pamatysite MySQL klaidos pranešimą mysql_close ($ conxb); 

For your convenience you can download the file reset.php from here . Jūsų patogumui galite parsisiųsti failų reset.phpčia.

Now extract the zip archive you've just downloaded and edit the necessary parameters to suit your needs (explanation comments are present in the PHP code above). Dabar išpakuokite ZIP archyvas Jūs ką tik atsisiųstų ir taisyti parametrus reikia pagal savo poreikius (paaiškinimai komentarai esantys PHP kodo aukščiau). Then upload the file reset.php to your wordpress root installation folder. Tada Įkelti failą reset.php savo šaknis WordPress diegimo aplanke. To make sure that this is the right directory, look for a file named wp-config.php , Norėdami įsitikinti, kad tai yra teisė kataloge suraskite failą pavadinimu wp-config.php, if it's there you're on the right way, else look for the directory where wp-config.php is present and upload the file reset.php there. jei jis ten you're on the right way, kitaip pažvelgti į katalogą, kur wp-config.php yra, ir įkelti failą reset.php ten.

Finally you'll want to go to http://yourDomainName.TLD/ reset.php . Galiausiai jūs norite eiti į http://yourDomainName.TLD/ reset.php. You'll see the appropriate message depending on how the script worked. Jūs pamatysite atitinkamą pranešimą, atsižvelgiant į tai, kaip scenarijų dirbo. If there is an error, post it here and I'll try to help you, else you did everything perfectly and you can now log in with your new password. Jei yra klaidų, praneškite čia ir mes pasistengsime jums padėti, nors jums padarė viską idealiai ir dabar Jūs galėsite prisijungti su nauju slaptažodžiu.

Translate this post Translate this post





Related posts: Related posts:

  1. Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? WordPress 2.8.4: Nėra paruoštas montavimui su PHP 5,3?
  2. Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script WordPress: Geriausios SEO iTranslator wordpress, gauti nemokamą srautą visiškai automatizuota įjungti scenarijų
  3. PHP Error: Call to a member function fetch_assoc() on a non-object in PHP error: Call to a member funkcija fetch_assoc () dėl ne daiktas
  4. PHP: How to get creation time of file with PHP on Linux machines PHP: Kaip sukurti laiko Bylos su PHP Linux mašinos
  5. Coding:How to fetch user profile data with SSI.php from a SMF forum database Kodai: Kaip įkelti naudotojo profilį duomenų SSI.php iš SMF forumas duomenų

    blog comments powered by Disqus Dienoraštis komentarus maitina Disqus