Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Viegli Reset Your account password Ar MySQL un PHP
Posted on 08. Posted on 08. Jun, 2009 by Dragos in Coding , MySQL , PHP Jun, 2009 by Dragos in Kodēšana, 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. Esmu tikko Aizmirsu admin paroli manām vietējās pārbaudes blogu, un kas ir sliktāk - mana vietējā mašīna nav konfigurēta, lai nosūtītu ārējā e-pastu. Oh yeah, got to reinstall wordpress again, what a pity. Oh yeah, got pārinstalēt WordPress atkal, kas žēl. No way! Nekādā veidā! There are two ways of resetting your password using two easy methods. Ir divi veidi, kā atiestatīt paroli, izmantojot divas vienkāršas metodes. You'll need basic knowledge of PHP or CPanel+PHPMyAdmin. Jums būs nepieciešams pamatzināšanas par PHP vai CPanel + PhpMyAdmin.
I Method: CPanel+PHPMyAdmin Es Metode: CPanel + PhpMyAdmin
For this method, it is necessary that your host have CPanel and PHPMyAdmin installed. Attiecībā uz šo metodi, ir nepieciešams, lai jūsu mītnes ir CPanel un PhpMyAdmin uzstādīta. 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. Ja jūsu mītnes nav šīs programmatūras gabalos, bet kaut kas līdzīgs šiem, jūs varat sekot šī apmācība un piemērot šos pasākumus, lai jūsu situāciju.
First we'll need to open the PHPMyAdmin page. Vispirms mums būs jāatver PhpMyAdmin lapu. From the CPanel root page, launch PHPMyAdmin. No CPanel saknes lapu sākt PhpMyAdmin. The icon of PHPMyAdmin should look similar to the one emphasized in the screenshot below. No PhpMyAdmin ikona būtu jāizskatās līdzīgi viens uzsvērts attēlā zemāk.
Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. Vienu reizi galvenajā lapā PhpMyAdmin Jums vajadzētu atcerēties, kas datu bāzē tu lietot, uzstādot WordPress. If you don't remember, don't get angry. Ja jūs neatceraties, 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. Iet uz jūsu saknes mape, kur WordPress ir uzstādīts un lejupielādēt & Atvērt datni wp-config.php ar vienkāršu teksta redaktoru, piemēram, Notepad / gedit. You'll need to find this line: Jums vajadzēs atrast šo pozīcija:
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. Ņemiet vērā, ka ABCD (bez vienas pēdiņas ap to) ir nosaukums datu bāzē, ka WordPress ir uzstādīta iekšā
Back on the PHPMyAdmin page, click on the link of your database name. Atpakaļ PhpMyAdmin lapā noklikšķiniet uz saites jūsu datu bāzes nosaukumu. In my case it was _iwebdevel . Manā gadījumā tā bija _iwebdevel.
Now you'll see another PHPMyAdmin page, but this time you'll be presented all your tables contained in the ABCD database. Tagad jūs redzēsiet citu PhpMyAdmin lapu, bet šoreiz jums būs jāuzrāda visas savas tabulas, kas ietvertas ABCD datu bāzē. We need to select the table users . Mums ir jāizvēlas tabulu lietotājiem. 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 neredzat tieši šādu nosaukumu lietotāji šo tabulu, bet nosaukumu šādā formātā xx_users, kur xx_ ir prefikss jūsu WordPress tabulu nosaukumi. Click on the link of your users table ( xx_users ). Klikšķiniet uz saites jūsu lietotāju tabulas (xx_users). In my case, as in most cases it's wp_users : Manā gadījumā, jo vairumā gadījumu tas wp_users:
Now click on browse to see the rows contained in table xx_users . Tagad noklikšķiniet uz Pārlūkot, lai aplūkotu rindas, kas tabulā xx_users.
Now look for the username you want to reset the password. Tagad meklē lietotājvārdu vēlaties atiestatīt paroli. In my case I want to reset password for admin. Now click on the edit button. Manā gadījumā es vēlos nomainīt paroli admin. Tagad noklikšķiniet uz pogas Rediģēt.
Now you'll need to generate an MD5 hash of the new password you would like to set. Tagad jums vajadzēs radīt MD5 hash of jaunu paroli, kuru jūs vēlētos kopu. Go to http://seoanalytic.com/tools/md5_encryptor/ and enter your preferred password. Go to http://seoanalytic.com/tools/md5_encryptor/ un ievadiet vēlamo paroli. After you enter your new password, click on the Encrypt! button. Kad jūs ievadiet jauno paroli, noklikšķiniet uz šifrēšana! Pogu.
After you've encrypted your password, select and copy the newly MD5 generated hash code. Pēc tam, kad esat šifrētu paroli, izvēlieties un kopēt tikko MD5 radīto hash kods.
Now return to your PHPMyAdmin page and paste your MD5 hash from the clipboard to the input field as shown in the image below: Tagad atgriezieties savā PhpMyAdmin lapu un ielīmējiet MD5 hash no starpliktuves ievades lauka, kā parādīts attēlā zemāk:
Finally click on Go button to save your new password. Visbeidzot noklikšķiniet uz Atvērt pogas, lai saglabātu savu jauno paroli.
II Method: PHP II metode: PHP
In my opinion the second method is much faster and simpler. Manuprāt otro metodi ir daudz ātrāk un vienkāršāk. In this method you'll just have to upload a PHP file to your host and access it with a browser. Šajā metodē jums vienkārši ir augšupielādēt PHP failu uzņēmējas un tai piekļūt ar pārlūkprogrammu. But we'll talk about it a little bit later. Bet mēs runājam par to mazliet vēlāk.
So here's the piece of PHP code I've came up with to help you reset your wordpress account password. Tātad šeit ir gabals PHP koda man nāca klajā ar jums palīdzēs nomainīt savu WordPress konta paroli.
$newPassword='NEW_PASSWORD_GOES_HERE'; //put your new password between the single quotes $ Newpassword = 'NEW_PASSWORD_GOES_HERE'; / / nodot jauno paroli starp vienu pēdiņām $username='admin'; //put the login username you'd like to change the password to $ username = 'admin'; / / izvirzīti Pievienoties Lietotājvārds vēlaties mainīt paroli @include_once('./wp-config.php'); //get some details from your wordpress installation @ include_once ( '. / wp-config.php'); / / dabūt no sava WordPress instalācijas detaļas 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); / / izveidotu savienojumu ar datu bāzi 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 = "update` '. $ table_prefix. "lietotāji", kas `user_pass` = \''. mysql_real_escape_string (md5 ($ Newpassword)). "\", kur "user_login` = \''. mysql_real_escape_string ($ username). '\' limit 1 "; $mQuery=mysql_query($query,$conxb); //set new password $ mQuery = mysql_query ($ query, $ conxb); / / set new password echo $mQuery?'Successfully set new password. echo $ mQuery? "veiksmīgi noteikt jaunu paroli. New password: '.$newPassword:'There was an error. Jaunā parole: '. $ Newpassword: "Radās kļūda. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message Error: ". Mysql_error (); / / if rezultāts ir neveiksmīga jūs redzēsiet mysql kļūdas ziņojums mysql_close($conxb); mysql_close ($ conxb);
For your convenience you can download the file reset.php from here . Jūsu ērtībai jūs varat lejupielādēt failu reset.php no šeit.
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). Tagad ekstrakts zip arhīvu esat tikai lejupielādēt un rediģētu nepieciešamos parametrus, lai tās atbilstu jūsu vajadzībām (paskaidrojums komentāri atrodas PHP kods iepriekš). Then upload the file reset.php to your wordpress root installation folder. Tad augšupielādēt failu reset.php savā WordPress saknes instalācijas mapi. To make sure that this is the right directory, look for a file named wp-config.php , Lai pārliecinātos, ka tas ir labi katalogs, meklēt Fails ar nosaukumu 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. ja tā ir tur jūs uz pareizā ceļa, cits meklē direktorijā, kur wp-config.php ir klāt un augšupielādēt failu reset.php tur.
Finally you'll want to go to http://yourDomainName.TLD/ reset.php . Visbeidzot jūs vēlaties doties uz http://yourDomainName.TLD/ reset.php. You'll see the appropriate message depending on how the script worked. Jūs redzēsiet atbilstošs ziņojums atkarībā no skripta strādā. 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. Ja ir kļūda, to šeit un es mēģināšu Jums palīdzēt, citādi jūs visu perfekti un tagad varat ieiet ar savu jauno paroli.
Related posts: Related posts:
- Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? WordPress 2.8.4: Nav gatavs uzstādīšanai ar 5,3 PHP?
- Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: Best SEO iTranslator uz WordPress, bezmaksas satiksme pilnībā automatizētu spraudnis script
- Wordpress: Version 2.8.6 is out. Wordpress: Version 2.8.6 ir ārpus. Make sure to update your blog! Pārliecinieties, lai atjauninātu savu emuāru!
- PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Call to locekļa funkciju fetch_assoc () par bez objekts
- PHP: How to get creation time of file with PHP on Linux machines PHP: Kā nokļūt creation time of failu ar PHP uz Linux mašīnām
- Katya Katya
- purie purie





















































