Today we would like to present you a way to change your admin account credentials even without the actual access to the admin panel itself. Crazy isn't it ? We will bring you down from the sky to the ground in just a minute. Fasten your seatbelts and here we go.
Trick or Treat?
Sometimes your admin credentials can be in danger. Sometimes the mess done by someone is so big that it may be not possible to access the admin dashboard to change them. What can we do next? Our webpage is not totally wasted! And that's why this emergency method is important to learn.
The series of steps we'll do are very simple. Mainly - we'll use the fact that we have access to the Wordpress Database and from it's level we'll change the users or passwords or both at the same time ;).
Step 1 - Find the name of your mySQL Database
Basically, first what you need to do is to log into your hosting backend and find your mySQL database. Hosting backends are usually run by so-called cPanel, a popular control panel that became a standard. Use username and password provided by your hosting company at the day of purchase and go to the 'mysql databases' tab.
Find out which database corresponds to your Wordpress website and open it. The quickest way is to log into your FTP directory and locate wp-config.php file. Upon opening try to locate 'db-name' or something simillar. Don't change anything in here. Just locate the name of database, write it somewhere and come back to hosting backend. There is also another way, simply open one of databases in an online tool to create, edit and delete databases, tables etc. and inspect each of the databases to recognize the correct one. The tool is called phpMyAdmin and it should be avaible for you in the 'databases' tab under your hosting backend. Search for tables beginning by the default wordpress prefix 'wp_' in the opened database. Prefix is a line of text that sits before each name of table. For example a table called 'users' in mysql database would have in this case a form of 'wp_users'.
Step 2 - Editing the Database
With the help of phpMyAdmin we'll edit our database. It's a simple online tool to create, edit and delete databases, tables etc. just like we've mentioned earlier. Navigate to the proper database and open it. Locate the correct table wp_users manually or with the help of search tool and browse it. Upon opening find a field that is called user_pass and edit it's value. As you probably have noticed the password is a string of 'strange' symbols and characters. This means that your password is encrypted and you won't be able to type in just plain text. Prepare your new password and go to MD5 Online Password Generator to generate it manually then copy the encrypted result into your user_pass field value. You can edit other user information like for example name. Save your changes and exit phpMyAdmin. Congratulations ! Your password have been changed.
In just two steps you've learned a very powerful trick to use in emergency situations (and not only :)).