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