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 Actualizări prin RSS | E-mail Get updates via feedburner Get updates via twitter
Home / Coding / MySQL / PHP / Wordpress: Easily Reset Your… Prima / codificare / MySQL / PHP / Wordpress: resetată uşor ta ...

Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: resetată uşor Contul dvs. parolă, folosind PHP si MySQL

Posted on 08. Postat la data de 08. Jun, 2009 by Dragos in Coding , MySQL , PHP Iunie, 2009 de către Dragos în codificare a mărfurilor, 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. Am uitat doar parola admin pe blog-ul meu de testare locale, şi ceea ce este mai rău - masina mea locală nu este configurat pentru a trimite e-mail externe. Oh yeah, got to reinstall wordpress again, what a pity. Oh, da, trebuie să reinstalaţi WordPress, din nou, ce păcat. No way! Nu se poate! There are two ways of resetting your password using two easy methods. Există două moduri de resetare parola dvs. utilizând două metode de uşor. You'll need basic knowledge of PHP or CPanel+PHPMyAdmin. Veţi avea nevoie de cunoştinţe de bază despre PHP, sau CPanel + phpMyAdmin.

I Method: CPanel+PHPMyAdmin Am Metoda: CPanel + PHPMyAdmin

For this method, it is necessary that your host have CPanel and PHPMyAdmin installed. Pentru această metodă, este necesar ca gazda dvs. au CPanel şi phpMyAdmin instalate. 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. În cazul în care gazda nu are aceste piese de software, dar ceva similar cu acestea, puteţi urma acest tutorial şi se aplică aceşti paşi pentru a situatiei dumneavoastra.

First we'll need to open the PHPMyAdmin page. În primul rând avem nevoie pentru a deschide pagina phpMyAdmin. From the CPanel root page, launch PHPMyAdmin. Din pagina rădăcină CPanel, lansare phpMyAdmin. The icon of PHPMyAdmin should look similar to the one emphasized in the screenshot below. Icoana PHPMyAdmin ar trebui să arate similar cu un accentuat în captura de ecran de mai jos.

PHPMyAdmin

PHPMyAdmin PHPMyAdmin

Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. O dată pe pagina principală a PHPMyAdmin trebuie să vă aduceţi aminte ce în baza de date ai folosit wordpress în momentul instalării. If you don't remember, don't get angry. Dacă nu vă amintiţi, nu se supara. 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. Du-te la folderul rădăcină WordPress în cazul în care este instalat şi descărca & deschide fişierul wp-config.php cu un editor de text simplu cum ar fi Notepad / gedit. You'll need to find this line: Veţi avea nevoie pentru a găsi această linie:

 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. Reţineţi că ABCD (fără ghilimele unică în jurul acestuia) este numele bazei de date pe care este instalat in WordPress

Back on the PHPMyAdmin page, click on the link of your database name. Inapoi pe pagina de phpMyAdmin, faceţi clic pe link-ul din numele bazei de date. In my case it was _iwebdevel . În cazul meu a fost _iwebdevel.

Select your database

Select your database Selectaţi baza de date

Now you'll see another PHPMyAdmin page, but this time you'll be presented all your tables contained in the ABCD database. Acum veţi vedea o altă pagină phpMyAdmin, dar de data aceasta vei fi prezentate toate tabelele dvs. conţinute în baza de date ABCD. We need to select the table users . Avem nevoie pentru a selecta utilizatorii de masă. 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. Nu veţi vedea utilizatorii denumirea exactă a acestui tabel, dar un nume în acest xx_users format, în cazul în care xx_ este prefixul de nume de dvs. de masă WordPress. Click on the link of your users table ( xx_users ). Faceţi clic pe link-ul a tabelului de utilizatori (xx_users). In my case, as in most cases it's wp_users : În cazul meu, ca şi în cele mai multe cazuri este wp_users:

Select the users table

Select the users table Selectaţi tabelul de utilizatori

Now click on browse to see the rows contained in table xx_users . Acum, faceţi clic pe Browse pentru a vedea rândurile conţinute în xx_users tabel.

Click on browse

Click on browse Faceţi clic pe Browse

Now look for the username you want to reset the password. Acum uită-te pentru numele de utilizator pe care doriţi să resetaţi parola. In my case I want to reset password for admin. Now click on the edit button. În cazul meu, vreau să reseta parola de administrator. Acum, faceţi clic pe butonul de editare.

Edit user's details

Edit user's details Editare utilizatorului detalii

Now you'll need to generate an MD5 hash of the new password you would like to set. Acum, veţi avea nevoie pentru a genera un hash MD5 a noua parola pe care doriţi să setaţi. Go to http://seoanalytic.com/tools/md5_encryptor/ and enter your preferred password. Du-te la http://seoanalytic.com/tools/md5_encryptor/ şi introduceţi parola dvs. preferat. After you enter your new password, click on the Encrypt! button. După ce introduceţi parola nouă, faceţi clic pe! Encrypt buton.

Encrypt your password

Encrypt your password Cripta parola dvs.

After you've encrypted your password, select and copy the newly MD5 generated hash code. După ce aţi criptat parola, selectaţi şi să copiaţi nou cod generat MD5 hash.

Select and copy the MD5 hash

Select and copy the MD5 hash Selectaţi şi copie 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: Acum a reveni la pagina dvs. de PHPMyAdmin şi lipiţi-vă hash MD5 din clipboard la câmpul de introducere aşa cum se arată în imaginea de mai jos:

Paste MD5 hash in the specified input field

Paste MD5 hash in the specified input field Paste MD5 hash în câmpul de introducere specificate

Finally click on Go button to save your new password. În cele din urmă faceţi clic pe butonul Go pentru a salva noua parola.

Save new password

Save new password Salvare parolă nouă

II Method: PHP Metoda II: PHP

In my opinion the second method is much faster and simpler. În opinia mea, a doua metodă este mult mai rapid şi mai simplu. In this method you'll just have to upload a PHP file to your host and access it with a browser. În această metodă va trebui doar să încărcaţi un fişier PHP pentru a gazda dumneavoastra si de acces-l cu un browser. But we'll talk about it a little bit later. Dar vom discuta despre aceasta un pic mai târziu.

So here's the piece of PHP code I've came up with to help you reset your wordpress account password. Deci, aici e bucata de cod PHP-am venit cu a vă ajuta să vă reseta parola wordpress cont.

  $newPassword='NEW_PASSWORD_GOES_HERE'; //put your new password between the single quotes $ Newpassword = 'NEW_PASSWORD_GOES_HERE'; / / pune noua parola între ghilimele simple 
	 $username='admin'; //put the login username you'd like to change the password to $ username = 'admin'; / / pus numele de utilizator autentificare pe care doriţi să modificaţi parola pentru a 
	 @include_once('./wp-config.php'); //get some details from your wordpress installation @ include_once ( '. / wp-config.php'); / / a lua nişte detalii de la instalarea dvs. WordPress 
	 global $table_prefix; global $ Table_Prefix; 
	 $conxb=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD); //establish connection to your database $ conxb = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD); / / a stabili conexiunea la baza de date 
	 mysql_select_db(DB_NAME,$conxb); 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'; $ query = 'actualizare `". $ Table_Prefix. "utilizatori", prevăzut `user_pass` = \''. mysql_real_escape_string (md5 ($ Newpassword)). "\" în cazul în care `user_login` = \''. mysql_real_escape_string ($ nume de utilizator). '\' limită de 1 '; 
	 $mQuery=mysql_query($query,$conxb); //set new password $ mQuery = mysql_query ($ interogare, $ conxb); / / set nouă parolă 
	 echo $mQuery?'Successfully set new password. echo $ mQuery? 'cu succes seta parola nouă. New password: '.$newPassword:'There was an error. Noua parola: '. $ Newpassword: "A fost o eroare. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message . Eroare: "mysql_error (); / / dacă rezultatul este nereuşită veţi vedea mesajul de MySQL Error 
	 mysql_close($conxb); mysql_close ($ conxb); 

For your convenience you can download the file reset.php from here . Pentru comoditatea Dvs. puteţi descărca reset.php dosar de la aici.

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). Acum extrageţi arhiva zip care le-aţi descărcat chiar şi a edita parametrii necesari pentru a se potrivi nevoilor dvs. (comentarii explicaţii, sunt prezente în codul PHP de mai sus). Then upload the file reset.php to your wordpress root installation folder. Apoi, încărcaţi fişierul reset.php la WordPress root folderul de instalare. To make sure that this is the right directory, look for a file named wp-config.php , Pentru a vă asigura că acesta este directorul de dreapta, căutaţi un fişier numit 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. în cazul în care este acolo esti pe drumul cel bun, altfel căutaţi directorul unde wp-config.php este prezent şi încărcaţi fişierul reset.php acolo.

Finally you'll want to go to http://yourDomainName.TLD/ reset.php . În cele din urmă veţi dori să merg la http://yourDomainName.TLD/ reset.php. You'll see the appropriate message depending on how the script worked. Veţi vedea un mesaj adecvat, în funcţie de modul în care script-ul a lucrat. 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. Dacă există o eroare, post it aici şi voi încerca să te ajut, altceva ai făcut totul perfect si a te putea autentifica acum în cu noua parola.

Translate this post Traduceţi acest post





Related posts: Legate de posturi:

  1. Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? Wordpress 2.8.4: Nu este gata pentru a fi instalate cu PHP 5.3?
  2. Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: Cel mai bun iTranslator SEO pentru WordPress, pentru a primi trafic gratuit de la script-ul plugin-ul complet automatizat
  3. PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Apel către un membru funcţie fetch_assoc () de pe un non-obiect în
  4. PHP: How to get creation time of file with PHP on Linux machines PHP: Cum să obţineţi timp crearea de fişier cu PHP pe maşini Linux
  5. Coding:How to fetch user profile data with SSI.php from a SMF forum database Codificare: Cum să-i aducă datele utilizatorului, cu profil de SSI.php de la o bază de date forum SMF

    blog comments powered by Disqus comentarii blog-ul creat de Disqus