We assume that you have lost control of your admin account by a hacked account or just forgotten. We are going to directly access the database via PHPMyAdmin.
In this post, we are working on a locally hosted site on WAMP. See our other post for a public hosted site on Cpanel with Siteground.
Using Mysqladmin we are going to look at
- How to find a list of admin users.
- How to change a username or email address
- How to change a user password
Find you wamp icon in the right side of the toolbar and left click on a menu. Choose phpMyAdmin
Choose phpMyAdmin and a web page with access to your MySql data will show.
Select the database table on the left. information_schema, MySQL, performance_schema and sys are all used by the system. So the remaining database should be yours. If you have multiple sites set up on WAMP, then you might have a choice.
All database tables should start wp_, but this prefix can be anything, so we will refer to all tables as wp_, eg wp_options, when yours could be xx_options or aoihfoiawf_options etc.
Check you have the right database
If you select the table wp_options and check the value of options_name siteurl and blogname this should confirm for you that you have the table you want.
Look at a list of users.
Now select the table wp_users. You see a list of all the users for your Site
Change user information
Once you have listed the users, that you can choose to edit the entry. Now you have the chance to change the username, email address or any other field. (Password is a special case, so see next section).
You can now change any of these fields and those changes will be immediate.
How to change the password
All passwords are encrypted, so to change a password, you need to encrypt the new password. You do this by setting the function as MD5 and enter the value for the new password in the a value box. This will then encrypt your password correctly for you.
Photo by Antoine Da cunha on Unsplash