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 | Email Get updates via feedburner Get updates via twitter
Home / Coding / MySQL / PHP / Wordpress: Easily Reset Your… Αρχική Σελίδα / Κωδικοποίηση / MySQL / PHP / Wordpress: Εύκολα Reset σας ...

Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Εύκολα Επαναφορά κωδικού πρόσβασης λογαριασμού σας χρησιμοποιώντας 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 μου για την τοπική δοκιμή blog μου, και τι είναι χειρότερο - τοπική μηχανή μου δεν έχει ρυθμιστεί να στείλετε e-mail εξωτερικό. Oh yeah, got to reinstall wordpress again, what a pity. Ω ναι, πήρα την επανεγκατάσταση wordpress πάλι, τι κρίμα. 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 I Μέθοδος: 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 πρέπει να μοιάζει με αυτό που τονίζεται στο screenshot κατωτέρω.

PHPMyAdmin

PHPMyAdmin PHPMyAdmin

Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. Φορά στην κύρια σελίδα του PHPMyAdmin θα πρέπει να θυμηθούμε τι έκανε βάση δεδομένων που χρησιμοποιείτε κατά την εγκατάσταση του wordpress. 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 in.

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. Τώρα θα πρέπει να δημιουργήσει μια MD5 hash του το νέο κωδικό πρόσβασης που θέλετε να ρυθμίσετε. 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! Κουμπί.

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 Επιλέξτε και αντιγράψτε το MD5 hash

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 σελίδα σας και επικολλήστε MD5 hash σας από το πρόχειρο στο πεδίο εισόδου, όπως φαίνεται στην παρακάτω εικόνα:

Paste MD5 hash in the specified input field

Paste MD5 hash in the specified input field Επικολλήστε MD5 hash στην καθορισμένη πεδίο εισαγωγής

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 = '? / / θέσει το login όνομα χρήστη που θέλετε να αλλάξετε τον κωδικό πρόσβασης για να
	@include_once('./wp-config.php'); //get some details from your wordpress installation @ include_once ( '. / WP-config.php')? / / πάρει κάποια στοιχεία από 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)? / / δημιουργία σύνδεση με τη βάση δεδομένων σας
	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). '\' όριο 1 '?
	$mQuery=mysql_query($query,$conxb); //set new password $ mQuery = mysql_query ($ query, $ conxb)? / / που το νέο κωδικό πρόσβασης
	echo $mQuery?'Successfully set new password. echo $ 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 ? Wordpress 2.8.4: Δεν είστε έτοιμοι να εγκατασταθεί με την PHP 5,3;
  2. Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: Καλύτερη iTranslator SEO για Wordpress, αποκτήσετε δωρεάν κυκλοφορίας από το πλήρως αυτοματοποιημένο πρόγραμμα plugin
  3. Wordpress: Version 2.8.6 is out. WordPress: Έκδοση 2.8.6 είναι έξω. Make sure to update your blog! Σιγουρευτείτε για να ενημερώσετε το blog σας!
  4. PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Σφάλμα: Κλήση σε ένα μέλος λειτουργία fetch_assoc () σε ένα μη-αντικείμενο
  5. PHP: How to get creation time of file with PHP on Linux machines PHP: Πώς να πάρει χρόνο δημιουργία του αρχείου με την PHP σε Linux μηχανές

  • Katya Katya
    :) :)
  • purie purie
    i have to try but why does still there error ? Πρέπει να προσπαθήσουμε, αλλά γιατί εξακολουθεί να υπάρχει λάθος; when i would to login.. πότε θα το έκανα για να συνδεθείτε .. cann`t read the password .. Cann `t διαβάσετε το password ..
    could you tell why does my code still error. θα μπορούσε να σας πει γιατί έχει τον κωδικό μου ακόμη σφάλματος. thank you σε ευχαριστώ
blog comments powered by Disqus blog παρατηρήσεις που κινούνται με Disqus