Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: Faċli Reset Your Account Password użu MySQL u PHP
Posted on 08. Posted on 08. Jun, 2009 by Dragos in Coding , MySQL , PHP Ġunju, 2009 minn Dragos fl-Kodifika, 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. Stajt biss forgot password admin tiegħi fuq blog tiegħi ittestjar lokali, u dak li huwa agħar - magna lokali tiegħi ma jkunx konfigurat biex tibgħat email esterni. Oh yeah, got to reinstall wordpress again, what a pity. Oh yeah, qbilna li jerġa wordpress darb'oħra, liema a pity. No way! Ebda mod! There are two ways of resetting your password using two easy methods. Hemm żewġ modi ta 'jerġa' jiġi issettjat l-password tiegħek billi jintużaw żewġ metodi faċli. You'll need basic knowledge of PHP or CPanel+PHPMyAdmin. Int ser ikollok bżonn l-għarfien bażiku ta 'PHP jew cPanel + PHPMyAdmin.
I Method: CPanel+PHPMyAdmin I Metodu: cPanel + PHPMyAdmin
For this method, it is necessary that your host have CPanel and PHPMyAdmin installed. Għal dan il-metodu, huwa meħtieġ li jospita tiegħek cPanel u PHPMyAdmin installati. 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. Jekk ospitanti tiegħek ma jkollux dawn il-biċċiet ta 'softwer, iżda xi ħaġa simili għal dawn, inti tista' ssegwi dan tutorja u japplikaw dawn il-passi għas-sitwazzjoni tiegħek.
First we'll need to open the PHPMyAdmin page. L-ewwel għandna bzonn biex tiftaħ il-paġna PHPMyAdmin. From the CPanel root page, launch PHPMyAdmin. Mill-paġna għerq cPanel, tnedija PHPMyAdmin. The icon of PHPMyAdmin should look similar to the one emphasized in the screenshot below. L-ikona tal-PHPMyAdmin għandhom jixxieħbu għall-waħda enfasizzat fil-screenshot hawn taħt.
Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. Darba fuq il-paġna prinċipali ta 'PHPMyAdmin għandek tiftakar dak id-database ma tuża wordpress meta l-installazzjoni. If you don't remember, don't get angry. Jekk ma tiftakarx, ma jsibux rrabjata. 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. Mur fil-folder għerq tiegħek wordpress fejn huwa installat u download & tiftaħ il-fajl WP-config.php bil-editur test sempliċi bħal notepad / GEdit. You'll need to find this line: Int ser ikollok bżonn issib din il-linja:
define('DB_NAME', 'ABCD'); jiddefinixxi ( "DB_NAME", "ABCD"); Note that ABCD (without the single quotes around it) is the name of the database that wordpress is installed in. Innota li ABCD (mingħajr il-kwotazzjonijiet uniku madwarha) huwa l-isem tad-database li tkun installata wordpress pulzieri
Back on the PHPMyAdmin page, click on the link of your database name. Lura fuq il-paġna PHPMyAdmin, ikklikkja fuq il-link ta 'l-isem database tiegħek. In my case it was _iwebdevel . Fil-każ tiegħi kien _iwebdevel.
Now you'll see another PHPMyAdmin page, but this time you'll be presented all your tables contained in the ABCD database. Issa tkun taf ara paġna oħra PHPMyAdmin, iżda din id-darba inti ser tiġi ppreżentata-tabelli kollha tiegħek fid-database ABCD. We need to select the table users . Għandna bżonn li jagħżlu l-utenti tabella. 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. Inti mhux se tara l-utenti l-isem eżatt ta 'din it-tabella, iżda isem f'dan xx_users-format, fejn xx_ huwa l-prefiss ta' ismijiet tiegħek tabella wordpress. Click on the link of your users table ( xx_users ). Ikklikkja fuq il-link tat-tabella tiegħek utenti (xx_users). In my case, as in most cases it's wp_users : Fil-każ tiegħi, bħal f'ħafna każi huwa wp_users:
Now click on browse to see the rows contained in table xx_users . Issa ikklikkja fuq jibbrawżjaw biex tara d-ringieli li jinsabu fl-xx_users tabella.
Now look for the username you want to reset the password. Issa tfittex l-username inti tixtieq li l-reset password. In my case I want to reset password for admin. Now click on the edit button. Fil-każ tiegħi nixtieq għal reset password għall admin. Issa ikklikkja fuq il-buttuna edit.
Now you'll need to generate an MD5 hash of the new password you would like to set. Issa ghandek bzonn biex jiġġenera hash MD5 ta 'l-password ġdida tixtieq stabbiliti. Go to http://seoanalytic.com/tools/md5_encryptor/ and enter your preferred password. Mur http://seoanalytic.com/tools/md5_encryptor/ u jidħlu password preferuta tiegħek. After you enter your new password, click on the Encrypt! button. Wara li inti tidħol new password tiegħek, ikklikkja fuq il-Encrypt! Buttuna.
After you've encrypted your password, select and copy the newly MD5 generated hash code. Wara li tkun ħadthom encrypted password tiegħek, agħżel l-ġodda u kopja MD5 iġġenerat kodiċi 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: Issa lura għall-paġna PHPMyAdmin tiegħek u paste hash MD5 tiegħek mill-clipboard għall-qasam input kif muri fil-immaġni hawn isfel:
Finally click on Go button to save your new password. Fl-aħħarnett ikklikkja fuq buttuna Mur jiffrankaw password ġdida tiegħek.
II Method: PHP II Metodu: PHP
In my opinion the second method is much faster and simpler. Fl-opinjoni tiegħi, it-tieni metodu huwa ħafna aktar mgħaġġla u aktar sempliċi. In this method you'll just have to upload a PHP file to your host and access it with a browser. F'dan il-metodu inti ser ikollu biss li ttella 'fajl PHP li jilqek u aċċess għaliha bi browser. But we'll talk about it a little bit later. Iżda aħna ser nitkellmu dwaru ftit aktar tard.
So here's the piece of PHP code I've came up with to help you reset your wordpress account password. So here's il-biċċa tal-kodiċi PHP stajt ħarāet bil jgħinuk reset password tiegħek kont 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"; / / mressqa new password tiegħek bejn il-kwotazzjonijiet uniku $ username admin = ""; / / tpoġġi l-username login tixtieq li jibdlu l-password biex @ include_once ( ". / WP-config.php "); / / nikseb xi dettalji minn stallazzjoni wordpress tiegħek globali table_prefix $; $ conxb = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD); / / jistabbilixxu konnessjoni ma 'database mysql_select_db tiegħek (DB_NAME, $ conxb); $ query =" aġġornament "" . table_prefix $. "utenti" sett ta `user_pass` = \''. mysql_real_escape_string (md5 ($ newPassword)). "\" meta "user_login` = \''. mysql_real_escape_string ($ username). "\" limitu ta '1 "; $ mQuery = mysql_query ($ mistoqsija, $ conxb); / / sett password ġdida eku $ mQuery? "għaddew sett password ġdida. New password: '.$newPassword:'There was an error. Password ġdida: ". NewPassword $:" Kien hemm żball. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message mysql_close($conxb); Error: ". Mysql_error (); / / jekk ir-riżultat huwa titlef int ser tara l-iżball mysql messaġġ mysql_close ($ conxb);
For your convenience you can download the file reset.php from here . Għal konvenjenza tiegħek tista 'tniżżel il-fajl reset.php minn hawn.
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). Issa l-arkivju estratt zip inti ħadthom biss mill-Internet u jeditjaw il-parametri meħtieġa biex jaqdu l-ħtiġijiet tiegħek (kummenti spjegazzjoni jkunu preżenti fil-kodiċi PHP hawn fuq). Then upload the file reset.php to your wordpress root installation folder. Imbagħad upload reset.php l-fajl lill folder tiegħek installazzjoni wordpress għerq. To make sure that this is the right directory, look for a file named wp-config.php , Biex tkun żgur li dan huwa l-direttorju dritt, tfittex għal fajl imsemmija 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. jekk huwa hemmhekk int dwar il-mod id-dritt, inkella tfittex fid-direttorju fejn WP-config.php ikun preżenti u l-upload reset.php fajl hemmhekk.
Finally you'll want to go to http://yourDomainName.TLD/ reset.php . Fl-aħħar nett tkun taf tixtieq tmur http://yourDomainName.TLD/ reset.php. You'll see the appropriate message depending on how the script worked. Int ser ikollok ara l-messaġġ ikun xieraq jiddependi fuq kif l-iskrittura maħduma. 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. Jekk ikun hemm żball, post it here u I'll jippruvaw jgħinuk, inkella inti ma kollox perfettament u inti issa tista 'login ma password ġdida tiegħek.
Related posts: Related postijiet:
- Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? Wordpress 2.8.4: Mhux lesta sabiex tkun installata ma PHP 5.3?
- Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: Best SEO iTranslator għall Wordpress, ġib it-traffiku ħieles mill-iskrittura plugin totalment awtomatizzati
- Wordpress: Version 2.8.6 is out. Wordpress: Version 2.8.6 huwa out. Make sure to update your blog! Kun żgur li taġġorna blog tiegħek!
- PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Sejħa għal membru funzjoni fetch_assoc () fuq bażi non-oġġett fil -
- PHP: How to get creation time of file with PHP on Linux machines PHP: Kif tikseb ħin ħolqien tal-fajl ma PHP fuq magni Linux
- Katya Katya
- purie purie





















































