Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Madaling I-reset ang iyong Account Password Paggamit ng MySQL at PHP
Posted on 08. Posted on 08. Jun, 2009 by Dragos in Coding , MySQL , PHP Hunyo, 2009 sa pamamagitan ng Dragos sa 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. Lamang ko na nakalimutan ang aking mga admin password sa aking mga lokal na pagsubok ng blog, at kung ano ang mas masama - ang aking mga lokal na makina na ito ay hindi nakaayos na magpadala ng mga panlabas na email. Oh yeah, got to reinstall wordpress again, what a pity. Oh yeah, got muling i-install wordpress muli, kung ano ang nakakalungkot. No way! Walang paraan! There are two ways of resetting your password using two easy methods. Mayroong dalawang paraan ng reset ang iyong password sa paggamit ng dalawang madaling paraan. You'll need basic knowledge of PHP or CPanel+PHPMyAdmin. Kakailanganin mo ang mga pangunahing kaalaman sa PHP o CPanel + PHPMyAdmin.
I Method: CPanel+PHPMyAdmin Ako Paraan: CPanel + PHPMyAdmin
For this method, it is necessary that your host have CPanel and PHPMyAdmin installed. Para sa ganitong paraan, ito ay kinakailangan na ang inyong mga hukbo ay may CPanel at PHPMyAdmin na naka-install. 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. Kung ang iyong hukbo ay hindi magkaroon ng mga piraso ng software, ngunit ang isang bagay na katulad ng sa mga ito, maaari mong sundin ang tutorial na ito at gamitin ang mga hakbang na ito sa iyong sitwasyon.
First we'll need to open the PHPMyAdmin page. Unang kakailanganin naming buksan ang PHPMyAdmin pahina. From the CPanel root page, launch PHPMyAdmin. Mula sa pahina ng CPanel ugat, ilunsad PHPMyAdmin. The icon of PHPMyAdmin should look similar to the one emphasized in the screenshot below. Ang icon ng PHPMyAdmin ay dapat magmukhang katulad ng emphasized sa screenshot sa ibaba.
Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. Kapag sa main page ng PHPMyAdmin dapat mong tandaan kung ano ang database ay gumamit ka kapag pag-install ng wordpress. If you don't remember, don't get angry. Kung hindi mo matandaan, huwag magalit. 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. Pumunta sa inyong root folder kung saan wordpress ay nai-install at i-download at buksan ang file WP-config.php sa isang simpleng text editor tulad ng Notepad / GEdit. You'll need to find this line: Kailangan mong hanapin ang linyang ito:
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. Tandaan na ang ABCD (nang walang single quotes sa paligid nito) ay ang pangalan ng database na wordpress ay na-install ka
Back on the PHPMyAdmin page, click on the link of your database name. Bumalik sa PHPMyAdmin pahina, i-click ang link ng iyong database ng pangalan. In my case it was _iwebdevel . Sa aking kaso, ito ay _iwebdevel.
Now you'll see another PHPMyAdmin page, but this time you'll be presented all your tables contained in the ABCD database. Ngayon makikita mo ang isa pang PHPMyAdmin pahina, ngunit sa oras na ito ikaw ay iharap ang lahat ng iyong mga talahanayan na nakapaloob sa database ng ABCD. We need to select the table users . Kailangan namin upang piliin ang mga gumagamit ng mesa. 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. Hindi mo makikita ang eksaktong mga gumagamit ng pangalan ng talahanayan na ito, ngunit ang isang pangalan sa xx_users format, kung saan xx_ ay ang prefix ng iyong wordpress pangalan ng mesa. Click on the link of your users table ( xx_users ). I-click ang link ng iyong mga gumagamit mesa (xx_users). In my case, as in most cases it's wp_users : Sa aking kaso, tulad ng sa karamihan ng mga kaso na ito wp_users:
Now click on browse to see the rows contained in table xx_users . Ngayon, mag-click sa i-browse upang makita ang mga hanay na nakapaloob sa xx_users mesa.
Now look for the username you want to reset the password. Ngayon hanapin ang username na gusto mong i-reset ang password. In my case I want to reset password for admin. Now click on the edit button. Sa aking kaso gusto kong i-reset ang password para sa admin. Ngayon, i-click ang edit button.
Now you'll need to generate an MD5 hash of the new password you would like to set. Ngayon, kailangan mong bumuo ng isang MD5 sumira ng bagong password na gusto mong set. Go to http://seoanalytic.com/tools/md5_encryptor/ and enter your preferred password. Pumunta sa http://seoanalytic.com/tools/md5_encryptor/ at ipasok ang iyong ginustong password. After you enter your new password, click on the Encrypt! button. Matapos na ipasok mo ang iyong bagong password, i-click sa pindutan ng Encrypt!.
After you've encrypted your password, select and copy the newly MD5 generated hash code. Matapos mong naka-encrypt ang iyong password, piliin at kopyahin ang mga MD5 bagong nabuo sumira code.
Now return to your PHPMyAdmin page and paste your MD5 hash from the clipboard to the input field as shown in the image below: Ngayon, bumalik sa iyong pahina ng PHPMyAdmin at idikit ang iyong MD5 sumira mula sa clipboard sa input field tulad ng ipinakita sa imahe sa ibaba:
Finally click on Go button to save your new password. Sa wakas-click sa Go button upang i-save ang iyong bagong password.
II Method: PHP II Paraan: PHP
In my opinion the second method is much faster and simpler. Sa aking opinyon ang ikalawang paraan ay mas mabilis at mas simple. In this method you'll just have to upload a PHP file to your host and access it with a browser. Sa ganitong paraan mo na lang ay mag-upload ng isang PHP file sa iyong host at ma-access ito sa isang browser. But we'll talk about it a little bit later. Ngunit kami ay makipag-usap tungkol sa mga ito nang kaunti mamaya.
So here's the piece of PHP code I've came up with to help you reset your wordpress account password. Kaya dito ang mga piraso ng code na PHP ko na ang dumating sa up para matulungan kayo na-reset ang iyong wordpress account password.
$newPassword='NEW_PASSWORD_GOES_HERE'; //put your new password between the single quotes $ newPassword = 'NEW_PASSWORD_GOES_HERE'; / / ilagay ang iyong bagong password sa pagitan ng isang quote $username='admin'; //put the login username you'd like to change the password to $ username = 'admin'; / / ilagay sa login username na gusto mong baguhin ang password sa @include_once('./wp-config.php'); //get some details from your wordpress installation @ include_once ( '. / WP-config.php'); / / kumuha ng ilang mga detalye mula sa iyong pag-install 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); / / makapagtatag ng koneksyon sa iyong database 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 = 'i-update ang `'. $ table_prefix. 'user-set` `user_pass` = \''. mysql_real_escape_string (MD5 ($ newPassword)).' \ 'kung saan `user_login` = \''. mysql_real_escape_string ($ username). '\' limitasyon 1 '; $mQuery=mysql_query($query,$conxb); //set new password $ mQuery = mysql_query ($ query, $ conxb); / / itakda ang bagong password echo $mQuery?'Successfully set new password. echo $ mQuery? 'Matagumpay na magtakda ng bagong password. New password: '.$newPassword:'There was an error. Bagong password: '. $ NewPassword:' Mayroong mali. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message . Mysql_error Error: '(); / / kung ang resulta ay hindi matagumpay na makikita mo ang MySQL error message mysql_close($conxb); mysql_close ($ conxb);
For your convenience you can download the file reset.php from here . Para sa iyong kaginhawaan maaari mong i-download ang file na reset.php mula dito.
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). Ngayon makuha ng zip archive lang mo-download at i-edit ang mga parameter na kinakailangan upang maging angkop sa iyong mga pangangailangan (paliwanag puna ay naroroon sa PHP code sa itaas). Then upload the file reset.php to your wordpress root installation folder. Pagkatapos ay i-upload ang file reset.php sa iyong wordpress root folder ng pag-install. To make sure that this is the right directory, look for a file named wp-config.php , Upang tiyakin na ito ay ang karapatan na direktoryo, tumingin para sa isang file na pinangalanang 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. kung ito ay mayroong ka sa kanan paraan, ang ibang tao hanapin ang directory kung saan WP-config.php ay naroroon at i-upload ang file reset.php doon.
Finally you'll want to go to http://yourDomainName.TLD/ reset.php . Panghuli gusto ninyong pumunta sa http://yourDomainName.TLD/ reset.php. You'll see the appropriate message depending on how the script worked. Makikita mo ang nararapat na mensahe depende sa kung paano script ang nagtrabaho. 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. Kung may isang error, post na ito dito at kukunin ko na subukan upang makatulong sa iyo, ikaw pa ang lahat ng bagay ay ganap na ganap at maaari ka na ngayon mag-log in gamit ang iyong bagong password.
Related posts: Related posts:
- Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? Wordpress 2.8.4: Di handa na ma-install sa PHP 5.3?
- Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: Pinakamagandang SEO iTranslator para sa Wordpress, makakakuha ng libreng trapiko mula sa lubos na automated na plugin script
- Wordpress: Version 2.8.6 is out. Wordpress: Version 2.8.6 ay out. Make sure to update your blog! Siguraduhin na i-update ang iyong blog!
- PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Tawag sa isang miyembro fetch_assoc function () sa isang hindi-bagay sa
- PHP: How to get creation time of file with PHP on Linux machines PHP: Paano upang makakuha ng paglikha ng oras ng file na may PHP sa Linux machine
- Katya Katya
- purie purie





















































