How to find wordpress admin account

My computer develop environment

$ cat /etc/issue
Ubuntu 14.04 LTS

Today, a friend found me. The employee responsible for maintaining the official website of his company left.
He did not record the Wordpress administrator account when he left. Can’t be reached in a short time.
My friend asked for my help, hoping to optimize the loading speed of Wordpress.
I searched for several plugins that can provide caching function, but it is very troublesome to enable and configure the plugin without logging in to the background without an administrator account.

Well,let’s try the function of recovering the password.

“I don’t know what the account is”.
“We didn’t equip Wordpress with a mailbox”.

-Careless boss said.

“Hmm .. bad things at this time”

Then let’s ask the database rudely.
Fortunately, WordPress “friendly” records the database connection method in wp-config.php.

Generally speaking, the administrator account of Wordpress is which ID is 1 or the first account of the table wp_users.
The password is encrypted with MD5, we only need to generate an MD5 encrypted password to replace the original password.

But! After trying these, I found out that the first three accounts are not administrator accounts!
I think we should look for better way.

Finally, I found that Wordpress has a user level, and the level 10 is the administrator.
Find the meta_key attribute wp_user_level in table wp_usermeta. The meta_value value is 10. The corresponding user_id is a number, and this number is the administrator ID.

Then let’s take a look at this SQL.

mysql> select * from wp_usermeta where meta_value = 10;
| umeta_id | user_id | meta_key | meta_value |
| 98 | 8 | wp_user_level | 10 |
2 rows in set (0.01 sec)

Ok! I found them! Easily solve!

Thank you for reading.
This post is copyrighted by Liyuliang’s Blog.
If reproduced, please indicate the source: Liyuliang’s Blog
This blog uses Creative Commons Attribution-NonCommercial-Share-Sharing 4.0 International License Agreement to license.

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now