Reset WordPress admin password using database:

 1. Find the database name in “wp-config.php” for the corresponding WP domain.

2. cd /var/lib/mysql

3. Take backup
   mysqldump databasename > databasename.sql

4. Enter into MySQL prompt.
   mysql

root@hostname# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2859662
Server version: 5.1.56-log MySQL Community Server (GPL)

mysql>

mysql> use databasename;

mysql> show tables;

5.check for ‘wp_users’ table.

mysql> select * from wp_users; (To check username)

mysql> update wp_users set user_pass=MD5(‘GIVE_STRONG_ADMIN_PASSWORD_HERE’) where  user_login=”admin”;

mysql> quit.

Now, try to access WordPress using new password.
 

Leave a Reply

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny