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 Aktualizacje pocztą RSS | Email Get updates via feedburner Get updates via twitter
Home / Coding / MySQL / PHP / Wordpress: Easily Reset Your… Strona główna / Coding / MySQL / PHP / Wordpress: łatwo zresetować Twoje ...

Wordpress: Easily Reset Your Account Password Using MySQL and PHP Wordpress: łatwo zresetować Twoje konto Hasło MySQL i PHP

Posted on 08. Zamieszczone w dniu 08. Jun, 2009 by Dragos in Coding , MySQL , PHP Cze, 2009 Dragos w 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. Właśnie zapomniałem hasła administratora na moim blogu lokalnych badań, a co gorsza - mój lokalny komputer nie jest skonfigurowany do wysyłania wiadomości e-mail zewnętrznych. Oh yeah, got to reinstall wordpress again, what a pity. Oh yeah, ale ponowna wordpress ponownie, jaka szkoda. No way! No way! There are two ways of resetting your password using two easy methods. Istnieją dwa sposoby resetowania hasła za pomocą dwóch łatwo metod. You'll need basic knowledge of PHP or CPanel+PHPMyAdmin. Musisz podstawowej znajomości PHP lub cPanel + phpMyAdmin.

I Method: CPanel+PHPMyAdmin I Metoda: cPanel + phpMyAdmin

For this method, it is necessary that your host have CPanel and PHPMyAdmin installed. W przypadku tej metody, konieczne jest posiadanie komputera ma cPanel i phpMyAdmin zainstalowane. 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. Jeśli serwer nie ma tych części oprogramowania, ale coś podobnego do tych, można śledzić ten artykuł i zastosować kroki do Twojej sytuacji.

First we'll need to open the PHPMyAdmin page. Najpierw musimy otworzyć stronę phpMyAdmin. From the CPanel root page, launch PHPMyAdmin. Od strony cPanel root uruchomić phpMyAdmin. The icon of PHPMyAdmin should look similar to the one emphasized in the screenshot below. Ikona phpMyAdmin powinien wyglądać podobnie do tego, podkreślił w poniższym zrzucie ekranu.

PHPMyAdmin

PHPMyAdmin PhpMyAdmin

Once on the main page of PHPMyAdmin you should remember what database did you use when installing wordpress. Gdy na stronie głównej phpMyAdmin należy pamiętać, bazy danych, co nie używać podczas instalacji WordPress. If you don't remember, don't get angry. Jeśli nie pamiętasz, nie złość. 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. Przejdź do folderu głównego, w którym zainstalowany jest wordpress i pobrać i otworzyć pliku wp-config.php z prostego edytora tekstu jak Notatnik / gedit. You'll need to find this line: Musisz znaleźć ten wiersz:

 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. Należy pamiętać, że ABCD (bez apostrofów wokół niego) to nazwa bazy danych, która jest zainstalowana in wordpress

Back on the PHPMyAdmin page, click on the link of your database name. Powrót na stronę phpMyAdmin, kliknij na link na swoją nazwę bazy danych. In my case it was _iwebdevel . W moim przypadku to był _iwebdevel.

Select your database

Select your database Wybierz bazę danych

Now you'll see another PHPMyAdmin page, but this time you'll be presented all your tables contained in the ABCD database. Teraz zobaczysz inną stronę phpMyAdmin, ale tym razem będziesz przedstawienie wszystkich tabel zawartych w bazie danych ABCD. We need to select the table users . Musimy wybrać użytkowników tabeli. 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. Nie zobaczysz taką użytkowników nazwę tabeli, ale nazwa w tym xx_users format, w którym xx_ jest prefiks WordPress nazwy tabeli. Click on the link of your users table ( xx_users ). Kliknij na link w tabeli użytkowników (xx_users). In my case, as in most cases it's wp_users : W moim przypadku, ponieważ w większości przypadków jest to wp_users:

Select the users table

Select the users table Wybierz tabeli użytkowników

Now click on browse to see the rows contained in table xx_users . Teraz kliknij na Przeglądaj, aby zobaczyć wiersze zawarte w xx_users tabeli.

Click on browse

Click on browse Kliknij przycisk Przeglądaj

Now look for the username you want to reset the password. Spójrzmy teraz na użytkownika którego chcesz zresetować hasło. In my case I want to reset password for admin. Now click on the edit button. W moim przypadku chcesz zresetować hasło administratora. Teraz kliknij na przycisk "edytuj".

Edit user's details

Edit user's details User Edytuj szczegóły

Now you'll need to generate an MD5 hash of the new password you would like to set. Teraz musisz wygenerować hash MD5 nowe hasło, którego chcesz ustawić. Go to http://seoanalytic.com/tools/md5_encryptor/ and enter your preferred password. Przejdź do http://seoanalytic.com/tools/md5_encryptor/ i wpisać wybrane hasło. After you enter your new password, click on the Encrypt! button. Po wprowadzeniu nowego hasła, kliknij! Szyfrowanie przycisk.

Encrypt your password

Encrypt your password Szyfrowanie hasła

After you've encrypted your password, select and copy the newly MD5 generated hash code. Po zaszyfrowane hasła, zaznaczyć i skopiować do nowo MD5 generowany kod hash.

Select and copy the MD5 hash

Select and copy the MD5 hash Zaznacz i skopiuj skrótu 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: Teraz wróć do strony phpMyAdmin i wklej skrótu MD5 ze schowka do pola, jak pokazano na obrazku poniżej:

Paste MD5 hash in the specified input field

Paste MD5 hash in the specified input field Wklej mieszania MD5 w określonym polu

Finally click on Go button to save your new password. Na koniec kliknij przycisk Go, aby zapisać nowe hasło.

Save new password

Save new password Zapisz nowe hasło

II Method: PHP II Metoda: PHP

In my opinion the second method is much faster and simpler. Moim zdaniem druga metoda jest znacznie szybsza i prostsza. In this method you'll just have to upload a PHP file to your host and access it with a browser. W ten sposób możesz po prostu przesłać plik PHP do przyjmującego i uzyskać do niej dostęp z przeglądarki. But we'll talk about it a little bit later. Ale porozmawiamy o tym trochę później.

So here's the piece of PHP code I've came up with to help you reset your wordpress account password. Więc oto fragment kodu PHP I've wymyślił, aby pomóc Ci zresetować wordpress hasło do konta.

  $newPassword='NEW_PASSWORD_GOES_HERE'; //put your new password between the single quotes $ newPassword = 'NEW_PASSWORD_GOES_HERE', / / wprowadzone nowe hasło pomiędzy pojedynczymi cudzysłowami 
	 $username='admin'; //put the login username you'd like to change the password to $ username = 'admin', / / nie login użytkownika, który chcesz zmienić hasło 
	 @include_once('./wp-config.php'); //get some details from your wordpress installation @ include_once ( '. / wp-config.php'); / / trochę informacji z wordpress instalacji 
	 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) / / ustanowienie połączenia z bazą danych 
	 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." użytkownikami "zestaw" user_pass `= \''. mysql_real_escape_string (md5 ($ newPassword)). '\', gdzie` user_login `= \''. mysql_real_escape_string ($ username). '\' limit 1 '; 
	 $mQuery=mysql_query($query,$conxb); //set new password $ mQuery = mysql_query ($ query, $ conxb) / / set new password 
	 echo $mQuery?'Successfully set new password. echo $ mQuery? powodzeniem ustawić nowe hasło. New password: '.$newPassword:'There was an error. NewPassword Nowe hasło: '. $: "Wystąpił błąd. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message Błąd: '. Mysql_error () / / jeśli wynik się nie powiedzie zostanie wyświetlony komunikat o błędzie mysql 
	 mysql_close($conxb); mysql_close ($ conxb); 

For your convenience you can download the file reset.php from here . Dla wygody możesz pobrać plik z reset.php tutaj.

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). Teraz rozpakuj archiwum zip Właśnie pobrać i zmienić odpowiednie parametry do własnych potrzeb (komentarze wyjaśnienia znajdują się w kodzie PHP powyżej). Then upload the file reset.php to your wordpress root installation folder. A następnie przesłać reset.php plik na wordpress folderu do instalacji. To make sure that this is the right directory, look for a file named wp-config.php , Aby upewnić się, że jest właściwym katalogu, poszukaj pliku o nazwie 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. jeśli tam jesteś na właściwej drodze, inaczej spojrzeć na katalog, w którym wp-config.php jest obecny i przesłać reset.php plik.

Finally you'll want to go to http://yourDomainName.TLD/ reset.php . Wreszcie będziesz chciał iść do http://yourDomainName.TLD/ reset.php. You'll see the appropriate message depending on how the script worked. Zostanie wyświetlony odpowiedni komunikat w zależności od scenariusza pracował. 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. Jeśli pojawi się błąd, po to tu i postaram się pomóc, bo w przeciwnym razie nie wszystko doskonale i można się zalogować na swoje nowe hasło.

Translate this post Translate this post


Related posts: Podobne posty:

  1. Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? WordPress 2.8.4: Nie gotowy do zainstalowania PHP 5.3?
  2. Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: Best iTranslator SEO Wordpress, stać się wolny ruch z pełni zautomatyzowany skrypt wtyczki
  3. PHP: How to get creation time of file with PHP on Linux machines PHP: Jak uzyskać czas utworzenia pliku z PHP na maszynach Linux
  4. PHP Error: Call to a member function fetch_assoc() on a non-object in PHP Error: Call to a member function fetch_assoc () w dniu wolnym od obiektu
  5. Coding:How to fetch user profile data with SSI.php from a SMF forum database Kodowanie: Jak pobrać dane z profilu użytkownika SSI.php z bazy danych SMF forum

  • Katya Katya
    :) :)
  • purie purie
    i have to try but why does still there error ? Muszę spróbować, ale dlaczego wciąż nie błąd? when i would to login.. kiedy to się zalogować .. cann`t read the password .. kan `t odczytać hasło ..
    could you tell why does my code still error. Można powiedzieć, dlaczego mój kod jeszcze błąd. thank you dziękuję
blog comments powered by Disqus blog komentarze powered by Disqus