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 עדכונים דרך RSS | אימייל Get updates via feedburner Get updates via twitter
Home / Coding / MySQL / PHP / Wordpress: Easily Reset Your… דף הבית / Coding / MySQL / PHP / וורדפרס: בקלות איפוס שלך ...

Wordpress: Easily Reset Your Account Password Using MySQL and PHP וורדפרס: בקלות איפוס סיסמת חשבון שלך באמצעות MySQL ו-PHP

Posted on 08. פורסם ב 08. Jun, 2009 by Dragos in Coding , MySQL , PHP יוני, 2009 על ידי Dragos ב וקידוד, 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. אני פשוט שכחתי את הסיסמא admin שלי בבלוג בדיקה המקומי שלי, ומה יותר גרוע - המחשב המקומי שלי אינו מוגדר שלח חיצוני. Oh yeah, got to reinstall wordpress again, what a pity. אה, כן, יש להתקין מחדש את וורדפרס שוב, כמה חבל. No way! בשום אופן לא! There are two ways of resetting your password using two easy methods. יש שתי דרכים של לאפס את הסיסמה שלך באמצעות שתי שיטות קל. You'll need basic knowledge of PHP or CPanel+PHPMyAdmin. תצטרך ידע בסיסי של PHP או CPanel + PHPMyAdmin.

I Method: CPanel+PHPMyAdmin אני שיטה: CPanel + PHPMyAdmin

For this method, it is necessary that your host have CPanel and PHPMyAdmin installed. שיטה זו, יש צורך כי המארח שלך יש CPanel ו PHPMyAdmin מותקן. 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. אם המארח שלך אין יצירות אלה של התוכנה, אבל משהו דומה אלה, תוכל לבצע מדריך זה וליישם את השלבים הבאים כדי המצב שלך.

First we'll need to open the PHPMyAdmin page. ראשית נצטרך לפתוח את דף PHPMyAdmin. From the CPanel root page, launch PHPMyAdmin. מדף CPanel שורש, השקת PHPMyAdmin. The icon of PHPMyAdmin should look similar to the one emphasized in the screenshot below. הסמל של PHPMyAdmin צריך להיראות דומה לזה הדגישו המסך למטה.

PHPMyAdmin

PHPMyAdmin PHPMyAdmin

Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. פעם בדף הראשי של PHPMyAdmin אתה צריך לזכור מה עשה לך להשתמש באתר בעת התקנת וורדפרס. If you don't remember, 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. עבור אל תיקיית השורש שלך שבו מותקן WordPress ולהוריד & לפתוח את הקובץ wp-config.php עם עורך טקסט פשוט כמו פנקס רשימות / gedit. You'll need to find this line: תצטרך למצוא את הקו הזה:

 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. שים לב כי ABCD (ללא המרכאות אחד סביבו) הוא שמו של מסד הנתונים כי WordPress מותקן פנימה

Back on the PHPMyAdmin page, click on the link of your database name. חזרה בדף PHPMyAdmin, לחץ על הקישור של שם מסד הנתונים שלך. In my case it was _iwebdevel . במקרה שלי זה היה _iwebdevel.

Select your database

Select your database בחר באתר שלך

Now you'll see another PHPMyAdmin page, but this time you'll be presented all your tables contained in the ABCD database. עכשיו תראה אחר דף PHPMyAdmin, אבל הפעם אתה תהיה הציג את כל הטבלאות שלך הכלול באתר ABCD. We need to select the table users . אנחנו צריכים לבחור את המשתמשים השולחן. 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. אתה לא תראה את השם המדויק של משתמשים בטבלה הזאת, אבל שם זה xx_users בתבנית, שבו הוא xx_ את הקידומת של שמות שולחן WordPress שלך. Click on the link of your users table ( xx_users ). לחץ על הקישור של משתמשי שולחן (xx_users) שלך. In my case, as in most cases it's wp_users : במקרה שלי, כמו ברוב המקרים זה wp_users:

Select the users table

Select the users table בחר את הטבלה משתמשים

Now click on browse to see the rows contained in table xx_users . כעת לחץ על עיון כדי לראות את שורות הכלול xx_users השולחן.

Click on browse

Click on browse לחץ על 'עיון

Now look for the username you want to reset the password. עכשיו לחפש את שם המשתמש ברצונך לאפס את הסיסמה. In my case I want to reset password for admin. Now click on the edit button. במקרה שלי אני רוצה לאפס את הסיסמה עבור admin. כעת לחץ על כפתור העריכה.

Edit user's details

Edit user's details עריכת פרטי המשתמש

Now you'll need to generate an MD5 hash of the new password you would like to set. עכשיו עליך ליצור hash MD5 של הסיסמה החדשה שאתה רוצה להגדיר. Go to http://seoanalytic.com/tools/md5_encryptor/ and enter your preferred password. עבור אל http://seoanalytic.com/tools/md5_encryptor/ והזן את הסיסמה המועדפת עליך. After you enter your new password, click on the Encrypt! button. לאחר הזנת הסיסמה החדשה שלך, לחץ על כפתור הצפן!.

Encrypt your password

Encrypt your password להצפין את הסיסמה שלך

After you've encrypted your password, select and copy the newly MD5 generated hash code. לאחר שביצעת את הסיסמה שלך מוצפן, לבחור ולהעתיק החדש שנוצר קוד MD5 hash.

Select and copy the MD5 hash

Select and copy the MD5 hash בחר להעתיק את hash של MD5

Now return to your PHPMyAdmin page and paste your MD5 hash from the clipboard to the input field as shown in the image below: עכשיו לחזור לדף PHPMyAdmin שלך והדבק hash MD5 שלך מהלוח לשדה הקלט כפי שמוצג בתמונה שלהלן:

Paste MD5 hash in the specified input field

Paste MD5 hash in the specified input field הדבק hash MD5 בשדה קלט שצוין

Finally click on Go button to save your new password. לבסוף לחץ על לחצן המשך כדי לשמור את הסיסמה החדשה שלך.

Save new password

Save new password שמור סיסמה חדשה

II Method: PHP השני שיטה: PHP

In my opinion the second method is much faster and simpler. לדעתי, השיטה השנייה היא הרבה יותר מהירה ופשוטה. In this method you'll just have to upload a PHP file to your host and access it with a browser. בשיטה זו, תצטרך להעלות קובץ PHP לארח שלך לגשת אליו עם דפדפן. But we'll talk about it a little bit later. אבל נדבר על זה קצת מאוחר יותר.

So here's the piece of PHP code I've came up with to help you reset your wordpress account password. אז הנה פיסת קוד PHP אני בא עם לעזור לך לאפס את הסיסמה לחשבון WordPress שלך.

  $newPassword='NEW_PASSWORD_GOES_HERE'; //put your new password between the single quotes $ newPassword = 'NEW_PASSWORD_GOES_HERE'; / / לשים את הסיסמא החדשה בין המרכאות יחיד 
	 $username='admin'; //put the login username you'd like to change the password to $ username = 'admin'; / / את שם המשתמש הכניסה תרצה לשנות את הסיסמה כדי 
	 @include_once('./wp-config.php'); //get some details from your wordpress installation @ include_once ( '. / wp-config.php'); / / לקבל קצת פרטים מתוך התקנה WordPress שלך 
	 global $table_prefix; הגלובלי $ 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); / / להקים חיבור למסד נתונים שלך 
	 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. "משתמשים` סט `user_pass` = \''. mysql_real_escape_string (md5 ($ newPassword)). "\" איפה `user_login` = \''. mysql_real_escape_string ($ username). '\' LIMIT 1 "; 
	 $mQuery=mysql_query($query,$conxb); //set new password $ mQuery = mysql_query ($ query, $ conxb); / / להגדיר סיסמה חדשה 
	 echo $mQuery?'Successfully set new password. הד $ mQuery? 'בהצלחה להגדיר סיסמה חדשה. New password: '.$newPassword:'There was an error. סיסמה חדשה: '. $ NewPassword: "היתה שגיאה. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message שגיאה: '. Mysql_error (); / / אם התוצאה אינה מצליחה תראה את הודעת השגיאה MySQL 
	 mysql_close($conxb); mysql_close ($ conxb); 

For your convenience you can download the file reset.php from here . למען הנוחות אתה יכול להוריד את הקובץ מן reset.php כאן שלך.

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). עכשיו לחלץ את ארכיון ה-zip לך פשוט להוריד ולערוך את הפרמטרים הנדרשים בהתאם לצרכיך (הערות הסבר נמצאים בקוד PHP לעיל). Then upload the file reset.php to your wordpress root installation folder. ואז להעלות את הקובץ לתיקיה reset.php ההתקנה WordPress השורש שלך. To make sure that this is the right directory, look for a file named wp-config.php , כדי לוודא כי זוהי הספרייה זכות, לחפש את הקובץ בשם 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. אם זה שם אתה בדרך הנכונה, לחפש אחר לספרייה שבה wp-config.php הוא ההווה reset.php להעלות את הקובץ שם.

Finally you'll want to go to http://yourDomainName.TLD/ reset.php . לבסוף אתה רוצה ללכת http://yourDomainName.TLD/ reset.php. You'll see the appropriate message depending on how the script worked. אתה תראה את המסר המתאים תלוי איך את התסריט עבד. 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. אם יש שגיאה, לפרסם אותו כאן ואני אנסה לעזור לך, אתה עוד לא הכל לגמרי ואתה יכול עכשיו להתחבר עם הסיסמה החדשה שלך.

Translate this post תרגם פירסום


Related posts: הודעות קשורות:

  1. Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? וורדפרס 2.8.4: לא מוכן להיות מותקן עם PHP 5.3?
  2. Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script וורדפרס: Best iTranslator SEO עבור וורדפרס, מקבלים תנועה חופשית סקריפט תוסף אוטומטי לחלוטין
  3. PHP: How to get creation time of file with PHP on Linux machines PHP: איך להגיע בזמן יצירת קובץ עם PHP על מכונות לינוקס
  4. PHP Error: Call to a member function fetch_assoc() on a non-object in PHP שגיאה: הסב חבר פונקציה fetch_assoc () on a non-האובייקט
  5. Coding:How to fetch user profile data with SSI.php from a SMF forum database קידוד: כיצד להביא את נתוני פרופיל המשתמש עם SSI.php ממסד נתונים SMF בפורום

  • Katya קטיה
    :) :)
  • purie purie
    i have to try but why does still there error ? אני חייב לנסות אבל למה עדיין יש שגיאה? when i would to login.. כאשר הייתי להתחבר .. cann`t read the password .. cann `לא קורא את הסיסמה ..
    could you tell why does my code still error. אתה יכול להגיד למה קוד שלי עדיין שגיאה. thank you תודה
blog comments powered by Disqus תגובות לבלוג powered by Disqus