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 Posodobitev prek RSS | Email Get updates via feedburner Get updates via twitter
Home / Coding / MySQL / PHP / Wordpress: Easily Reset Your… Domov / Coding / MySQL / PHP / Wordpress: lahek Reset Your ...

Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: lahek Ponastavi geslo za svoj račun z uporabo MySQL in PHP

Posted on 08. Objavljeno dne 08. Jun, 2009 by Dragos in Coding , MySQL , PHP Junij 2009, ki ga Dragos v Coding, 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. Pravkar sem Pozabil sem admin geslo na mojem lokalnem testiranja blog, in kaj je slabše - moje lokalne stroj ni nastavljen za pošiljanje e-pošte zunanje. Oh yeah, got to reinstall wordpress again, what a pity. Oh ja, sem se zopet WordPress spet, kaj škoda. No way! Ni šans! There are two ways of resetting your password using two easy methods. Obstajata dva načina za ponastavitev vašega gesla z uporabo dveh preprostih metod. You'll need basic knowledge of PHP or CPanel+PHPMyAdmin. Potrebovali boste osnovno znanje PHP ali Cpanel + PHPMyAdmin.

I Method: CPanel+PHPMyAdmin I Metoda: Cpanel + PHPMyAdmin

For this method, it is necessary that your host have CPanel and PHPMyAdmin installed. Za to metodo, je treba, da je vaš gostitelj so Cpanel in PHPMyAdmin nameščen. 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. Če vaša gostiteljica nima teh delov programske opreme, ampak nekaj podobnega s temi, lahko sledite tem Tutorial in uporabljajo te ukrepe za vašo situacijo.

First we'll need to open the PHPMyAdmin page. Najprej bomo morali, da odprete stran PHPMyAdmin. From the CPanel root page, launch PHPMyAdmin. Na strani korena Cpanel, začetek PHPMyAdmin. The icon of PHPMyAdmin should look similar to the one emphasized in the screenshot below. Ikona PHPMyAdmin mora izgledati podobna tisti poudaril v screenshot spodaj.

PHPMyAdmin

PHPMyAdmin PHPMyAdmin

Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. Ko na glavno stran PHPMyAdmin morate zapomniti, kaj baze podatkov ste uporabili pri namestitvi WordPress. If you don't remember, don't get angry. Če se ne spomnite, ne razjezil. 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. Pojdite na korensko mapo, kjer je nameščen WordPress in prenesete in odprete datoteko wp-config.php z preprost urejevalnik besedila, kot Beležnica / gedit. You'll need to find this line: Boste morali najti v tej vrstici:

 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. Upoštevajte, da ABCD (brez enotnega narekovaje okoli nje), je ime baze, ki je nameščen WordPress palcev

Back on the PHPMyAdmin page, click on the link of your database name. Nazaj na stran PHPMyAdmin, kliknite na povezavo vaše ime podatkovne baze. In my case it was _iwebdevel . V mojem primeru je bilo _iwebdevel.

Select your database

Select your database Izberite svojo zbirko podatkov

Now you'll see another PHPMyAdmin page, but this time you'll be presented all your tables contained in the ABCD database. Zdaj boste videli drugo stran PHPMyAdmin, vendar tokrat boste treba predložiti vse svoje tabele, vsebovane v zbirki podatkov ABCD. We need to select the table users . Moramo izbrati tabelo uporabniki. 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. Ne boste videli točno ime uporabnika te tabele, ampak ime v tej obliki xx_users, kjer xx_ je predpona vaše wordpress imena tabele. Click on the link of your users table ( xx_users ). Kliknite na povezavo vašega uporabnikov tabele (xx_users). In my case, as in most cases it's wp_users : V mojem primeru, kot je v večini primerov je wp_users:

Select the users table

Select the users table Izberite uporabnikov tabelo

Now click on browse to see the rows contained in table xx_users . Sedaj kliknite na brskati za prikaz vrstic iz tabele xx_users.

Click on browse

Click on browse Kliknite na brskanje

Now look for the username you want to reset the password. Poglej za uporabniško ime želite ponastaviti geslo. In my case I want to reset password for admin. Now click on the edit button. V mojem primeru želim za ponastavitev gesla za admin. Sedaj kliknite na gumb uredi.

Edit user's details

Edit user's details Urejanje uporabnika podrobnosti

Now you'll need to generate an MD5 hash of the new password you would like to set. Zdaj boste potrebovali za ustvarjanje MD5 hash za novo geslo, ki ga želite nastaviti. Go to http://seoanalytic.com/tools/md5_encryptor/ and enter your preferred password. Pojdi na http://seoanalytic.com/tools/md5_encryptor/ in vnesite želeno geslo. After you enter your new password, click on the Encrypt! button. Ko vnesete novo geslo, kliknite na Encrypt! Gumb.

Encrypt your password

Encrypt your password Encrypt your password

After you've encrypted your password, select and copy the newly MD5 generated hash code. Potem, ko ste šifrirano geslo, izberite in kopirajte na novo ustvarjenih MD5 haše zbornik.

Select and copy the MD5 hash

Select and copy the MD5 hash Izberite in kopijo MD5 haše

Now return to your PHPMyAdmin page and paste your MD5 hash from the clipboard to the input field as shown in the image below: Sedaj vrniti na svojo stran PHPMyAdmin in prilepite MD5 haše iz odložišča v vnosno polje, kot je prikazano na sliki spodaj:

Paste MD5 hash in the specified input field

Paste MD5 hash in the specified input field Paste MD5 haše v določenem polje za vnos

Finally click on Go button to save your new password. Na koncu kliknite na gumb Pojdi shraniti novo geslo.

Save new password

Save new password Shrani novo geslo

II Method: PHP II Metoda: PHP

In my opinion the second method is much faster and simpler. Po mojem mnenju druga metoda je veliko hitrejši in preprostejši. In this method you'll just have to upload a PHP file to your host and access it with a browser. Na ta način boste vi šele življati v upload pila v vaš gostitelj PHP in dostop z brskalnikom. But we'll talk about it a little bit later. Ampak bomo govoril o tem malce kasneje.

So here's the piece of PHP code I've came up with to help you reset your wordpress account password. Torej, tukaj je del kode PHP sem prišel z vam pomaga ponovno nastaviti vaše geslo wordpress račun.

	$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'; / / dal novo geslo med enojnih narekovajih $ username = 'admin'; / / dana login uporabniško ime, ki ga želite spremeniti geslo za @ include_once ( ". / wp-config.php '); / / zaslužiti nekaj podrobnosti iz vašega WordPress namestitev global $ Table_Prefix; $ conxb = mysql_connect (DB_Host, DB_USER, DB_Password); / / vzpostavi povezavo z zbirko podatkov mysql_select_db (DB_Name, $ conxb); $ query =' update "" . $ Table_Prefix. "uporabniki", ki `user_pass` = \''. mysql_real_escape_string (md5 ($ Newpassword)). "\", kjer `user_login` = \''. mysql_real_escape_string ($ username). "\" mejne 1 "; $ mQuery = mysql_query ($ query, $ conxb) / / set new password echo $ mQuery? "Uspešno je novo geslo. New password: '.$newPassword:'There was an error. Novo geslo: ". $ Newpassword:" Prišlo je do napake. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message mysql_close($conxb); Napaka: ". Mysql_error (); / / če je rezultat je uspela boste videli sporočilo o napaki mysql mysql_close ($ conxb); 

For your convenience you can download the file reset.php from here . Za vaše udobje si lahko prenesete datoteke reset.php od tukaj.

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). Zdaj citat žvižg svod ki ste ga pravkar prenesli in urediti potrebne parametre, ki ustrezajo vašim potrebam (razlaga pripombe so prisotne v PHP kodo zgoraj). Then upload the file reset.php to your wordpress root installation folder. Nato naložite datoteko reset.php v vaš korenski namestitvi wordpress mapo. To make sure that this is the right directory, look for a file named wp-config.php , Če se želite prepričati, da je to pravica imenik, poiščite datoteko z imenom 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. če je tam ste na pravi poti, drugi iščejo imenik wp-config.php, kjer je prisoten in naložite datoteko reset.php tam.

Finally you'll want to go to http://yourDomainName.TLD/ reset.php . Končno boste želeli iti http://yourDomainName.TLD/ reset.php. You'll see the appropriate message depending on how the script worked. Videli boste ustrezno sporočilo, odvisno od tega, kako skript delal. 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. Če je napaka, mesto je tukaj in jaz bom poskusil, da vam pomaga, drugače si vse, kar je odlično in lahko zdaj prijavite z novim geslom.

Translate this post Prevedi to post





Related posts: Podobni objav:

  1. Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? Wordpress 2.8.4: Ni pripravljen za namestitev s PHP 5,3?
  2. Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: Best SEO iTranslator za Wordpress, zaslužiti prost promet iz povsem avtomatiziran plugin script
  3. PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Call na člana funkcijo fetch_assoc () na non-predmeta
  4. PHP: How to get creation time of file with PHP on Linux machines PHP: Kako ustvarjanje časa datoteke s PHP na računalnikih Linux
  5. Coding:How to fetch user profile data with SSI.php from a SMF forum database Coding: Kako puščati podatkov uporabnikov profil z SSI.php iz baze foruma SMF

    blog comments powered by Disqus blog comments powered by Disqus