Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: hõlpsalt taastada oma konto parool kasutate MySQL ja PHP
Posted on 08. Postitatud 08. Jun, 2009 by Dragos in Coding , MySQL , PHP Juuni, 2009 Dragos in kodeerimise, 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. Ma olen lihtsalt unustanud oma admin parooli oma kohaliku katsetamine blogi, ja mis veelgi hullem - oma kohaliku masin ei ole seadistatud saatma väline e-posti. Oh yeah, got to reinstall wordpress again, what a pity. Oh jah, pead uuesti WordPress uuesti, milline kahju. No way! Mitte mingil juhul! There are two ways of resetting your password using two easy methods. On kaks võimalust parooli uuesti kasutades kaks lihtsat meetodit. You'll need basic knowledge of PHP or CPanel+PHPMyAdmin. Pead põhiteadmised PHP või cPanel + PhpMyAdmin.
I Method: CPanel+PHPMyAdmin I Method: cPanel + PhpMyAdmin
For this method, it is necessary that your host have CPanel and PHPMyAdmin installed. Käesoleva meetodi puhul on vaja, et teie vastuvõtva on cPanel ja PhpMyAdmin installitud. 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. Kui teie vastuvõtva ei ole neid tükki tarkvara, kuid midagi sarnast nendele, siis tuleb järgida käesolevas õpetamisel ja kohaldavad neid samme oma olukorra.
First we'll need to open the PHPMyAdmin page. Kõigepealt pead alustama PhpMyAdmin lehel. From the CPanel root page, launch PHPMyAdmin. Alates cPanel root lehel käivitada PhpMyAdmin. The icon of PHPMyAdmin should look similar to the one emphasized in the screenshot below. Ikoon PhpMyAdmin peaks välja nägema sarnane rõhutada pildil.
Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. Pärast peamiste lehele PhpMyAdmin peate meeles pidama, mida andmebaasi sa kasutada paigaldamisel WordPress. If you don't remember, don't get angry. Kui te ei mäleta, ei pahanda. 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. Mine juurkataloogi, kus WordPress on paigaldatud lae ja ava fail wp-config.php lihtsa tekstiredaktoriga, näiteks Notepad / GEdit. You'll need to find this line: Palutakse leida rida:
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. Pange tähele, et ABCD (ilma ühe jutumärgid ümber) on andmebaasi nimi, et WordPress on paigaldatud sisse
Back on the PHPMyAdmin page, click on the link of your database name. Tagasi PhpMyAdmin lehel kliki lingil oma andmebaasi nimi. In my case it was _iwebdevel . Minu puhul oli see _iwebdevel.
Now you'll see another PHPMyAdmin page, but this time you'll be presented all your tables contained in the ABCD database. Nüüd näete teise PhpMyAdmin leht, kuid seekord saate esitada kõik oma tabelid ABCD andmebaasi. We need to select the table users . Meil tuleb valida tabelis kasutajatele. 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. Sa ei näe täpne nimi kasutajat selles tabelis, kuid nimi sellisel kujul xx_users, kus xx_ on eesliide oma WordPress tabeli nimed. Click on the link of your users table ( xx_users ). Klõpsake lingil oma kasutajate tabelis (xx_users). In my case, as in most cases it's wp_users : Minu puhul on enamikel juhtudel see wp_users:
Now click on browse to see the rows contained in table xx_users . Nüüd klõpsa sirvida, et näha ridade sisalduva tabeli xx_users.
Now look for the username you want to reset the password. Nüüd otsige kasutajanime soovite taastada parool. In my case I want to reset password for admin. Now click on the edit button. Minu puhul tahan taastada parool admin. Nüüd klõpsa nuppu Muuda.
Now you'll need to generate an MD5 hash of the new password you would like to set. Nüüd peate genereerida MD5 räsi uus parool, mida soovite määrata. Go to http://seoanalytic.com/tools/md5_encryptor/ and enter your preferred password. Mine http://seoanalytic.com/tools/md5_encryptor/ ja sisestage soovitud salasõna. After you enter your new password, click on the Encrypt! button. Kui olete sisestanud uue parooli, klõpsa krüptimine! Nuppu.
After you've encrypted your password, select and copy the newly MD5 generated hash code. Kui olete krüptitud parooli, kopeeri ja äsja MD5 tekkivad räsikoodi.
Now return to your PHPMyAdmin page and paste your MD5 hash from the clipboard to the input field as shown in the image below: Nüüd tagasi oma PhpMyAdmin leht ja kleebi MD5 räsi lõikepuhvrist väljale nagu näidatud alloleval pildil:
Finally click on Go button to save your new password. Lõpuks vajuta Go nuppu, et salvestada uus parool.
II Method: PHP II meetod: PHP
In my opinion the second method is much faster and simpler. Minu arvates on teine meetod on palju kiirem ja lihtsam. In this method you'll just have to upload a PHP file to your host and access it with a browser. Selle meetodi saad lihtsalt saata PHP fail oma peremees ja juurdepääs selle brauseriga. But we'll talk about it a little bit later. Aga me räägime sellest natuke hiljem.
So here's the piece of PHP code I've came up with to help you reset your wordpress account password. Nii et siin on tükk PHP koodi Olen tulid välja, et aidata teil taastada oma WordPress konto parool.
$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 "/ / pane uus parool vahel ühe quotes $ username =' admin '; / / pani Sisenen Kasutajanimi soovite muuta salasõna @ include_once (". / wp-config.php '); / / saada mõned andmed oma WordPress paigaldus global $ table_prefix $ conxb = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD); / / luua ühendus oma andmebaasi mysql_select_db (DB_NAME $ conxb) $ query = "update" " . $ table_prefix. "kasutajad" kehtestatud "user_pass` = \''. mysql_real_escape_string (md5 ($ newPassword)). '\ "kui" user_login `= \''. mysql_real_escape_string ($ kasutajanimi).' \ 'piir 1"; $ mQuery = mysql_query ($ query, $ conxb); / / määrata uue parooli echo $ mQuery? "õnnestus uue parooli. New password: '.$newPassword:'There was an error. Uus parool: ". $ NewPassword:" Tekkis viga. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message mysql_close($conxb); Viga: '. Mysql_error (); / / kui tulemus ei õnnestu näed MySQL veateade mysql_close ($ conxb);
For your convenience you can download the file reset.php from here . Teie mugavuse huvides võite alla laadida fail reset.php alates siin.
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). Nüüd väljavõte zip arhiiv sa oled alla laadida ja muuta vajalikke parameetreid oma vajadustele (seletuste kommentaarid on kohal PHP koodi eespool). Then upload the file reset.php to your wordpress root installation folder. Seejärel laadige fail reset.php oma WordPress root installikaust. To make sure that this is the right directory, look for a file named wp-config.php , Veendumaks, et see on õige kataloogi, otsige fail 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. kui see on olemas olete õiges suunas, muidu Vaata kataloogi kus wp-config.php on olemas fail ja laadige reset.php seal.
Finally you'll want to go to http://yourDomainName.TLD/ reset.php . Lõpuks tahad minna http://yourDomainName.TLD/ reset.php. You'll see the appropriate message depending on how the script worked. Näete asjakohane teade olenevalt kuidas script töötas. 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. Kui on viga, pärast seda siin ja mina püüame sind aidata, muidu sa tegid kõik täiesti ja saab nüüd sisse logida oma uue parooli.
Related posts: Seonduvad postitused:
- Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? Wordpress 2.8.4: Ei ole valmis olema paigaldatud PHP 5,3?
- Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: Best SEO iTranslator WordPress, tasuta liiklus täielikult automatiseeritud plugin script
- PHP Error: Call to a member function fetch_assoc() on a non-object in PHP error: Call to liikme funktsiooni fetch_assoc () kedagi objekti
- PHP: How to get creation time of file with PHP on Linux machines PHP: Kuidas loomise ajal faili PHP Linux masinatega
- Coding:How to fetch user profile data with SSI.php from a SMF forum database Kood: Kuidas tõmmata kasutajaprofiili andmete SSI.php alates SMF foorumi andmebaas





















































