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 Aggiornamenti via RSS | Email Get updates via feedburner Get updates via twitter
Home / Coding / MySQL / PHP / Wordpress: Easily Reset Your… Home / Coding / MySQL / PHP / Wordpress: Facilmente Reset Your ...

Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Facilmente Reset Your Account password che utilizza MySQL e PHP

Posted on 08. Posted on 08. Jun, 2009 by Dragos in Coding , MySQL , PHP Giugno, 2009 da Dragos in 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. Ho appena dimenticato la mia password di amministratore sul mio blog test locali, e quel che è peggio - la mia macchina locale non è configurato per inviare e-mail esterni. Oh yeah, got to reinstall wordpress again, what a pity. Oh yeah, got a reinstallare wordpress di nuovo, che peccato. No way! No way! There are two ways of resetting your password using two easy methods. Ci sono due modi di reimpostare la password utilizzando due metodi facile. You'll need basic knowledge of PHP or CPanel+PHPMyAdmin. Avrete bisogno di una conoscenza di base di PHP o CPanel + PHPMyAdmin.

I Method: CPanel+PHPMyAdmin I Metodo: CPanel + PHPMyAdmin

For this method, it is necessary that your host have CPanel and PHPMyAdmin installed. Per questo metodo, è necessario che il vostro ospite hanno CPanel e PHPMyAdmin installato. 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. Se l'host non ha questi pezzi di software, ma qualcosa di simile a questi, potete seguire questa guida e applicare questi passaggi a vostra situazione.

First we'll need to open the PHPMyAdmin page. In primo luogo abbiamo bisogno di aprire la pagina PHPMyAdmin. From the CPanel root page, launch PHPMyAdmin. Dalla pagina principale CPanel, lancio PHPMyAdmin. The icon of PHPMyAdmin should look similar to the one emphasized in the screenshot below. L'icona di PHPMyAdmin dovrebbe essere simile a quello evidenziato nello screenshot qui sotto.

PHPMyAdmin

PHPMyAdmin PHPMyAdmin

Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. Una volta sulla pagina principale di PHPMyAdmin si dovrebbe ricordare ciò che database hai usato wordpress durante l'installazione. If you don't remember, don't get angry. Se non ti ricordi, non arrabbiarti. 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. Vai alla cartella principale dove è installato wordpress e scaricare e aprire il file wp-config.php con un semplice editor di testo come Notepad / gedit. You'll need to find this line: Avrete bisogno di trovare questa riga:

 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. Si noti che ABCD (senza le virgolette singole intorno ad esso) è il nome del database che wordpress è installato a.

Back on the PHPMyAdmin page, click on the link of your database name. Torna alla pagina PhpMyAdmin, clicca sul link del nome del database. In my case it was _iwebdevel . Nel mio caso è stato _iwebdevel.

Select your database

Select your database Seleziona il tuo database

Now you'll see another PHPMyAdmin page, but this time you'll be presented all your tables contained in the ABCD database. Ora vedrete un'altra pagina PhpMyAdmin, ma questa volta vi verrà presentato tutte le tabelle contenute nel database di ABCD. We need to select the table users . Abbiamo bisogno di selezionare la tabella di utenti. 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. Non vedrete gli utenti esatto nome di questa tavola, ma un nome in questo xx_users formato, dove Xx_ è il prefisso dei nomi tabella wordpress. Click on the link of your users table ( xx_users ). Cliccare sul link dei vostri utenti da tavola (xx_users). In my case, as in most cases it's wp_users : Nel mio caso, come nella maggior parte dei casi è wp_users:

Select the users table

Select the users table Selezionare la tabella utenti

Now click on browse to see the rows contained in table xx_users . Ora cliccate su Sfoglia per visualizzare le righe contenute nella tabella xx_users.

Click on browse

Click on browse Fare clic su Sfoglia

Now look for the username you want to reset the password. Ora cerca il nome utente che si desidera reimpostare la password. In my case I want to reset password for admin. Now click on the edit button. Nel mio caso voglio reimpostare la password per l'admin. Ora cliccate sul tasto edit.

Edit user's details

Edit user's details Dettagli user's Edit

Now you'll need to generate an MD5 hash of the new password you would like to set. Ora è necessario generare un hash MD5 della nuova password che si desidera impostare. Go to http://seoanalytic.com/tools/md5_encryptor/ and enter your preferred password. Vai a http://seoanalytic.com/tools/md5_encryptor/ e immettere la password desiderata. After you enter your new password, click on the Encrypt! button. Dopo aver inserito la nuova password, clicca sul Encrypt! Pulsante.

Encrypt your password

Encrypt your password Crittografare la tua password

After you've encrypted your password, select and copy the newly MD5 generated hash code. Dopo aver codificato la tua password, selezionare e copiare il codice generato appena MD5 hash.

Select and copy the MD5 hash

Select and copy the MD5 hash Selezionare e copiare l'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: Ora tornare alla pagina PHPMyAdmin e incollare la hash MD5 dagli appunti per il campo di input, come mostrato nell'immagine qui sotto:

Paste MD5 hash in the specified input field

Paste MD5 hash in the specified input field Pasta di hash MD5 nel campo di input specificata

Finally click on Go button to save your new password. Infine, fare clic sul pulsante Vai per salvare la nuova password.

Save new password

Save new password Salva nuova password

II Method: PHP Metodo II: PHP

In my opinion the second method is much faster and simpler. A mio parere il secondo metodo è molto più veloce e semplice. In this method you'll just have to upload a PHP file to your host and access it with a browser. In questo metodo dovrete semplicemente per caricare un file PHP per il vostro ospite e accedervi con un browser. But we'll talk about it a little bit later. Ma noi ne parliamo un po 'più tardi.

So here's the piece of PHP code I've came up with to help you reset your wordpress account password. Quindi, ecco il pezzo di codice PHP che ho si avvicinò con per aiutarti a reimpostare la password di account wordpress.

	$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' $ / / mettere la nuova password tra le virgolette singole $ username = 'admin'; / / inserire il nome utente di accesso che si desidera modificare la password di @ include_once ( '. / wp-config.php '); / / ottenere alcuni dettagli della tua installazione di Wordpress Global table_prefix $; $ conxb = mysql_connect (db_host, db_user, DB_PASSWORD); / / stabilire la connessione al database mysql_select_db (DB_NAME, $ conxb); $ query =' update ` ' . $ table_prefix. 'utenti `set` user_pass `= \''. mysql_real_escape_string (md5 ($ newPassword)).' \ ', dove` user_login `= \''. mysql_real_escape_string ($ username).' \ 'limite di 1'; $ mDomanda = mysql_query ($ query, $ conxb); / / impostare la nuova password echo $ mDomanda? 'impostare correttamente la nuova password. New password: '.$newPassword:'There was an error. New password: '. $ NewPassword:' C'è stato un errore. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message mysql_close($conxb); Errore: '. Mysql_error (); / / Se il risultato non è riuscita vedrete il messaggio di errore MySQL mysql_close ($ conxb); 

For your convenience you can download the file reset.php from here . Per la vostra comodità è possibile scaricare il file reset.php da qui.

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). Ora estrarre l'archivio zip che avete appena scaricato e modificare i parametri necessari per soddisfare le proprie esigenze (commenti spiegazione sono presenti nel codice PHP sopra). Then upload the file reset.php to your wordpress root installation folder. Reset.php quindi caricare il file nella cartella di installazione di wordpress root. To make sure that this is the right directory, look for a file named wp-config.php , Per assicurarsi che questa sia la giusta directory, cercare un file chiamato 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. se è lì siete sulla strada giusta, altrimenti cercherà la directory wp-config.php in cui è presente e caricare il file reset.php lì.

Finally you'll want to go to http://yourDomainName.TLD/ reset.php . Infine si vuole andare a http://yourDomainName.TLD/ reset.php. You'll see the appropriate message depending on how the script worked. Vedrai il messaggio appropriato a seconda di come lo script ha funzionato. 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. Se c'è un errore, inserisci qui e cercherò di aiutarvi, altrimenti avete fatto tutto alla perfezione e ora è possibile accedere con la tua nuova password.

Translate this post Traduci questo post


Related posts: Related posts:

  1. Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? Wordpress 2.8.4: Non sei ancora pronto per essere installato con PHP 5,3?
  2. Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: iTranslator Best SEO per Wordpress, ottenere il traffico gratuito da script plug completamente automatizzato
  3. Wordpress: Version 2.8.6 is out. Wordpress: versione 2.8.6 è fuori. Make sure to update your blog! Assicurati di aggiornare il tuo blog!
  4. PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Errore: Chiamata a una funzione membro fetch_assoc () su un non-oggetto in
  5. PHP: How to get creation time of file with PHP on Linux machines PHP: Come ottenere il tempo di creazione del file con PHP su macchine Linux

  • Katya Katya
    :) :)
  • purie Purie
    i have to try but why does still there error ? devo provare ma perché ancora lì errore? when i would to login.. quando mi sarebbe il login .. cann`t read the password .. cann `t leggere la password ..
    could you tell why does my code still error. potrebbe dire per quale motivo il mio codice di errore ancora. thank you grazie
blog comments powered by Disqus commenti del blog powered by Disqus