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. Я просто забыла пароль администратора на моем блоге местного тестирование и, что еще хуже - моя локальная машина не настроена на внешние отправить электронную почту. 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 Я Метод: 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 должна быть похожей на одну подчеркнул на скриншоте ниже.
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 и скачать & открыть файл РГ-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.
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:
Now click on browse to see the rows contained in table xx_users . Теперь нажмите кнопку Обзор, чтобы увидеть строк, содержащихся в таблице xx_users.
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. В моем случае я хочу, чтобы сбросить пароль администратора. Теперь нажмите на кнопку Изменить.
Now you'll need to generate an MD5 hash of the new password you would like to set. Теперь вам нужно сгенерировать 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. После ввода нового пароля, нажмите на Шифровать! Кнопки.
After you've encrypted your password, select and copy the newly MD5 generated hash code. После того как вы зашифрованный пароль, выбрать и скопировать новую Generated 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 и вставьте MD5 хеш из буфера обмена в поле ввода, как показано на рисунке ниже:
Finally click on Go button to save your new password. Наконец, нажмите на кнопку Go, чтобы сохранить новый пароль.
II Method: PHP II Метод: 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 $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' / / положить новый пароль между одиночными кавычками Имя пользователя $ = 'Админ'; / / поставить Логин Имя пользователя вы хотите изменить пароль для @ include_once ( '. / WP-config.php '); / / получить некоторые детали из вашей установки WordPress глобальной $ table_prefix; $ conxb = mysql_connect (db_host, db_user, DB_PASSWORD) / / установить соединение с базой данных mysql_select_db (db_name, $ conxb); $ запрос =' Обновить ` ' . table_prefix $. 'пользователям набор `` user_pass `= \''. mysql_real_escape_string (md5 ($ Newpassword)).' \ ', где` user_login `= \''. mysql_real_escape_string ($ Имя пользователя).' \ 'LIMIT 1'; $ mQuery = mysql_query ($ запроса, $ conxb); / / установить новый пароль Эхо $ mQuery? успешно установлен новый пароль. New password: '.$newPassword:'There was an error. Новый пароль: '. $ Newpassword: "Был ошибка. Error: '.mysql_error(); //if result is unsuccessful you'll see the mysql error message mysql_close($conxb); Ошибка: '. Mysql_error (); / / если результат неудачного вы увидите MySQL 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 , Чтобы убедиться, что это правильный каталог, искать файл с именем РГ-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. если оно там вы на верном пути, иначе посмотреть на каталог, в котором РГ-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. Если есть ошибки, задайте его здесь, и я постараюсь помочь вам, иначе вы все сделали отлично и теперь вы можете войти с новым паролем.
Related posts: Похожие сообщения:
- Wordpress 2.8.4: Not ready to be installed with PHP 5.3 ? Wordpress 2.8.4: Не готовы к установке с PHP 5.3?
- Wordpress: Best SEO iTranslator for Wordpress, get free traffic from fully automated plugin script Wordpress: Лучшие SEO iTranslator для WordPress, получить бесплатный трафик с полностью автоматизированной плагина сценария
- PHP Error: Call to a member function fetch_assoc() on a non-object in PHP ошибка: Вызов функции-члена FETCH_ASSOC () на не-объект в
- PHP: How to get creation time of file with PHP on Linux machines PHP: Как получить время создания файла с PHP на компьютерах Linux
- Coding:How to fetch user profile data with SSI.php from a SMF forum database Кодирование: Как извлечь профиля пользователя SSI.php с данными из базы данных форумом SMF





















































