Reset wp-admin password via linux command line
Reset wp-admin password via Linux command line
Hello folks,
Forgot your wp-admin password ? No problem, We can simply reset it via DB. I ‘m gonna show you how to reset wp-admin password via command line.
Step 1. Login to your server or VPS as root
Step 2. Find your site DB
Here my test website is `lalbros.cf`.
How to find DB ? just switch to your sites root directory then type the following command
grep DB wp-login.php
Then you could see something like this
[[email protected] lalbros.cf]# grep DB wp-config.php define('DB_NAME', 'adminbir_wp274'); define('DB_USER', 'adminbir_wp274'); define('DB_PASSWORD', 'qp](63w0rS'); define('DB_HOST', 'localhost'); define('DB_CHARSET', 'utf8'); define('DB_COLLATE', '');
Here my DB is adminbir_wp274
Step 3. Login to Mysql as root
Then use the DB
mysql> use adminbir_wp274;
Step4. show tables
mysql > show tables; +----------------------------+ | Tables_in_adminbir_wp274 | +----------------------------+ | wpb1_chat_log | | wpb1_chat_message | | wpb1_commentmeta | | wpb1_comments | | wpb1_links | | wpb1_options | | wpb1_postmeta | | wpb1_posts | | wpb1_term_relationships | | wpb1_term_taxonomy | | wpb1_termmeta | | wpb1_terms | | wpb1_usermeta | | wpb1_users | | wpb1_wplc_chat_msgs | | wpb1_wplc_chat_sessions | | wpb1_wplc_offline_messages | +----------------------------+
Here we need the table wp_users sometime it may varies like wpb1_users and wptf_users so on
Step5. verify the user details
mysql > SELECT ID, user_login, user_pass FROM wpb1_users;
Current database: adminbir_wp274 +----+------------+------------------------------------+ | ID | user_login | user_pass | +----+------------+------------------------------------+ | 1 | admin | $P$Btcp44x00nyRIPnmAxV23ch4btKQ461 | +----+------------+------------------------------------+ 1 row in set (0.05 sec)
Here admin is the user and passwod is encrypted by md5 format
Step6. To update new password
Here is my new password is lalbros
mysql > UPDATE wpb1_users SET user_pass = MD5('lalbros') WHERE ID=1 LIMIT 1;
That’s all, password updated
To see new updated password
mysql > UPDATE wpb1_users SET user_pass = MD5(lalbros) WHERE ID=1 LIMIT 1; mysql > quit Bye
Step 7. Check the new login details.
That’s all…cheers….!!!